summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-05-21 12:52:33 -0700
committerStephen Rothwell <sfr@canb.auug.org.au>2008-06-13 09:28:53 +1000
commit43ba0cb030a518118c00d13268b010cde7942400 (patch)
treeb611b4430e5d5000b84487b9690a76ea0d113e2c /sound
parentf1faf9bbea136bf60496529144d8805c29a41d4b (diff)
device create: sound: convert device_create to device_create_drvdata
device_create() is race-prone, so use the race-free device_create_drvdata() instead as device_create() is going away. Cc: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/init.c5
-rw-r--r--sound/oss/soundcard.c14
-rw-r--r--sound/sound_core.c5
3 files changed, 14 insertions, 10 deletions
diff --git a/sound/core/init.c b/sound/core/init.c
index ac0573416130..7722c0dcff98 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -535,8 +535,9 @@ int snd_card_register(struct snd_card *card)
snd_assert(card != NULL, return -EINVAL);
#ifndef CONFIG_SYSFS_DEPRECATED
if (!card->card_dev) {
- card->card_dev = device_create(sound_class, card->dev, 0,
- "card%i", card->number);
+ card->card_dev = device_create_drvdata(sound_class, card->dev,
+ MKDEV(0, 0), NULL,
+ "card%i", card->number);
if (IS_ERR(card->card_dev))
card->card_dev = NULL;
}
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index a9c23b2502ad..7d89c081a086 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -560,17 +560,19 @@ static int __init oss_init(void)
sound_dmap_flag = (dmabuf > 0 ? 1 : 0);
for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
- device_create(sound_class, NULL,
- MKDEV(SOUND_MAJOR, dev_list[i].minor),
- "%s", dev_list[i].name);
+ device_create_drvdata(sound_class, NULL,
+ MKDEV(SOUND_MAJOR, dev_list[i].minor),
+ NULL, "%s", dev_list[i].name);
if (!dev_list[i].num)
continue;
for (j = 1; j < *dev_list[i].num; j++)
- device_create(sound_class, NULL,
- MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
- "%s%d", dev_list[i].name, j);
+ device_create_drvdata(sound_class, NULL,
+ MKDEV(SOUND_MAJOR,
+ dev_list[i].minor + (j*0x10)),
+ NULL,
+ "%s%d", dev_list[i].name, j);
}
if (sound_nblocks >= 1024)
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 46daca175502..fb13ba2946ef 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -170,8 +170,9 @@ static int sound_insert_unit(struct sound_unit **list, const struct file_operati
else
sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP);
- device_create(sound_class, dev, MKDEV(SOUND_MAJOR, s->unit_minor),
- s->name+6);
+ device_create_drvdata(sound_class, dev,
+ MKDEV(SOUND_MAJOR, s->unit_minor),
+ NULL, s->name+6);
return r;
fail: