aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/hwdep.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2006-10-05 10:02:22 -0400
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:00:10 -0500
commit9244b2c3079faac79b3b961116bd548c45087e2c (patch)
tree1a9e2ead054ed58efcad3fd43fb2aedeb6731baa /sound/core/hwdep.c
parentd595ee7e0162ae66faa8c4c7d8c2069b40d64fed (diff)
[ALSA] alsa core: convert to list_for_each_entry*
This patch converts most uses of list_for_each to list_for_each_entry all across alsa. In some place apparently an item can be on a list with different pointers so of course that isn't compatible with list_for_each, I therefore didn't touch those places. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/core/hwdep.c')
-rw-r--r--sound/core/hwdep.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index 46b47689362c..a6a6ad0ad3c8 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -47,14 +47,11 @@ static int snd_hwdep_dev_disconnect(struct snd_device *device);
47 47
48static struct snd_hwdep *snd_hwdep_search(struct snd_card *card, int device) 48static struct snd_hwdep *snd_hwdep_search(struct snd_card *card, int device)
49{ 49{
50 struct list_head *p;
51 struct snd_hwdep *hwdep; 50 struct snd_hwdep *hwdep;
52 51
53 list_for_each(p, &snd_hwdep_devices) { 52 list_for_each_entry(hwdep, &snd_hwdep_devices, list)
54 hwdep = list_entry(p, struct snd_hwdep, list);
55 if (hwdep->card == card && hwdep->device == device) 53 if (hwdep->card == card && hwdep->device == device)
56 return hwdep; 54 return hwdep;
57 }
58 return NULL; 55 return NULL;
59} 56}
60 57
@@ -468,15 +465,12 @@ static int snd_hwdep_dev_disconnect(struct snd_device *device)
468static void snd_hwdep_proc_read(struct snd_info_entry *entry, 465static void snd_hwdep_proc_read(struct snd_info_entry *entry,
469 struct snd_info_buffer *buffer) 466 struct snd_info_buffer *buffer)
470{ 467{
471 struct list_head *p;
472 struct snd_hwdep *hwdep; 468 struct snd_hwdep *hwdep;
473 469
474 mutex_lock(&register_mutex); 470 mutex_lock(&register_mutex);
475 list_for_each(p, &snd_hwdep_devices) { 471 list_for_each_entry(hwdep, &snd_hwdep_devices, list)
476 hwdep = list_entry(p, struct snd_hwdep, list);
477 snd_iprintf(buffer, "%02i-%02i: %s\n", 472 snd_iprintf(buffer, "%02i-%02i: %s\n",
478 hwdep->card->number, hwdep->device, hwdep->name); 473 hwdep->card->number, hwdep->device, hwdep->name);
479 }
480 mutex_unlock(&register_mutex); 474 mutex_unlock(&register_mutex);
481} 475}
482 476