Commit 6195cfbd authored by Domen Puncer's avatar Domen Puncer Committed by Greg Kroah-Hartman

[PATCH] USB: use list_for_each() in class/audio.c

Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 17dfaa02
...@@ -1954,9 +1954,9 @@ static int usb_audio_open_mixdev(struct inode *inode, struct file *file) ...@@ -1954,9 +1954,9 @@ static int usb_audio_open_mixdev(struct inode *inode, struct file *file)
struct usb_audio_state *s; struct usb_audio_state *s;
down(&open_sem); down(&open_sem);
for (devs = audiodevs.next; devs != &audiodevs; devs = devs->next) { list_for_each(devs, &audiodevs) {
s = list_entry(devs, struct usb_audio_state, audiodev); s = list_entry(devs, struct usb_audio_state, audiodev);
for (mdevs = s->mixerlist.next; mdevs != &s->mixerlist; mdevs = mdevs->next) { list_for_each(mdevs, &s->mixerlist) {
ms = list_entry(mdevs, struct usb_mixerdev, list); ms = list_entry(mdevs, struct usb_mixerdev, list);
if (ms->dev_mixer == minor) if (ms->dev_mixer == minor)
goto mixer_found; goto mixer_found;
...@@ -2644,9 +2644,9 @@ static int usb_audio_open(struct inode *inode, struct file *file) ...@@ -2644,9 +2644,9 @@ static int usb_audio_open(struct inode *inode, struct file *file)
for (;;) { for (;;) {
down(&open_sem); down(&open_sem);
for (devs = audiodevs.next; devs != &audiodevs; devs = devs->next) { list_for_each(devs, &audiodevs) {
s = list_entry(devs, struct usb_audio_state, audiodev); s = list_entry(devs, struct usb_audio_state, audiodev);
for (adevs = s->audiolist.next; adevs != &s->audiolist; adevs = adevs->next) { list_for_each(adevs, &s->audiolist) {
as = list_entry(adevs, struct usb_audiodev, list); as = list_entry(adevs, struct usb_audiodev, list);
if (!((as->dev_audio ^ minor) & ~0xf)) if (!((as->dev_audio ^ minor) & ~0xf))
goto device_found; goto device_found;
...@@ -3835,7 +3835,7 @@ static void usb_audio_disconnect(struct usb_interface *intf) ...@@ -3835,7 +3835,7 @@ static void usb_audio_disconnect(struct usb_interface *intf)
usb_set_intfdata (intf, NULL); usb_set_intfdata (intf, NULL);
/* deregister all audio and mixer devices, so no new processes can open this device */ /* deregister all audio and mixer devices, so no new processes can open this device */
for(list = s->audiolist.next; list != &s->audiolist; list = list->next) { list_for_each(list, &s->audiolist) {
as = list_entry(list, struct usb_audiodev, list); as = list_entry(list, struct usb_audiodev, list);
usbin_disc(as); usbin_disc(as);
usbout_disc(as); usbout_disc(as);
...@@ -3847,7 +3847,7 @@ static void usb_audio_disconnect(struct usb_interface *intf) ...@@ -3847,7 +3847,7 @@ static void usb_audio_disconnect(struct usb_interface *intf)
} }
as->dev_audio = -1; as->dev_audio = -1;
} }
for(list = s->mixerlist.next; list != &s->mixerlist; list = list->next) { list_for_each(list, &s->mixerlist) {
ms = list_entry(list, struct usb_mixerdev, list); ms = list_entry(list, struct usb_mixerdev, list);
if (ms->dev_mixer >= 0) { if (ms->dev_mixer >= 0) {
unregister_sound_mixer(ms->dev_mixer); unregister_sound_mixer(ms->dev_mixer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment