diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-01 19:41:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-01 19:41:07 -0500 |
commit | 4549df891a31b9a05b7d183106c09049b79327be (patch) | |
tree | d4dfd0921f0dd0dba2525fd33c0962b26ba5ff1e /sound/core/sound.c | |
parent | 6b8cc71ab2619a776b02869fd733ac1ead3db4e8 (diff) | |
parent | e17e0f51aeea4e59c7e450a1c0f26605b91c1260 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
Driver core: show drivers in /sys/module/
Documentation/driver-model/platform.txt update/rewrite
Driver core: platform_driver_probe(), can save codespace
driver core: Use klist_remove() in device_move()
driver core: Introduce device_move(): move a device to a new parent.
Driver core: make drivers/base/core.c:setup_parent() static
driver core: Introduce device_find_child().
sysfs: sysfs_write_file() writes zero terminated data
cpu topology: consider sysfs_create_group return value
Driver core: Call platform_notify_remove later
ACPI: Change ACPI to use dev_archdata instead of firmware_data
Driver core: add dev_archdata to struct device
Driver core: convert sound core to use struct device
Driver core: change mem class_devices to be real devices
Driver core: convert fb code to use struct device
Driver core: convert firmware code to use struct device
Driver core: convert mmc code to use struct device
Driver core: convert ppdev code to use struct device
Driver core: convert PPP code to use struct device
Driver core: convert cpuid code to use struct device
...
Diffstat (limited to 'sound/core/sound.c')
-rw-r--r-- | sound/core/sound.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sound/core/sound.c b/sound/core/sound.c index efa476c5210a..282742022de6 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -61,9 +61,6 @@ EXPORT_SYMBOL(snd_ecards_limit); | |||
61 | static struct snd_minor *snd_minors[SNDRV_OS_MINORS]; | 61 | static struct snd_minor *snd_minors[SNDRV_OS_MINORS]; |
62 | static DEFINE_MUTEX(sound_mutex); | 62 | static DEFINE_MUTEX(sound_mutex); |
63 | 63 | ||
64 | extern struct class *sound_class; | ||
65 | |||
66 | |||
67 | #ifdef CONFIG_KMOD | 64 | #ifdef CONFIG_KMOD |
68 | 65 | ||
69 | /** | 66 | /** |
@@ -268,11 +265,10 @@ int snd_register_device(int type, struct snd_card *card, int dev, | |||
268 | snd_minors[minor] = preg; | 265 | snd_minors[minor] = preg; |
269 | if (card) | 266 | if (card) |
270 | device = card->dev; | 267 | device = card->dev; |
271 | preg->class_dev = class_device_create(sound_class, NULL, | 268 | preg->dev = device_create(sound_class, device, MKDEV(major, minor), |
272 | MKDEV(major, minor), | 269 | "%s", name); |
273 | device, "%s", name); | 270 | if (preg->dev) |
274 | if (preg->class_dev) | 271 | dev_set_drvdata(preg->dev, private_data); |
275 | class_set_devdata(preg->class_dev, private_data); | ||
276 | 272 | ||
277 | mutex_unlock(&sound_mutex); | 273 | mutex_unlock(&sound_mutex); |
278 | return 0; | 274 | return 0; |
@@ -320,7 +316,7 @@ int snd_unregister_device(int type, struct snd_card *card, int dev) | |||
320 | return -EINVAL; | 316 | return -EINVAL; |
321 | } | 317 | } |
322 | 318 | ||
323 | class_device_destroy(sound_class, MKDEV(major, minor)); | 319 | device_destroy(sound_class, MKDEV(major, minor)); |
324 | 320 | ||
325 | kfree(snd_minors[minor]); | 321 | kfree(snd_minors[minor]); |
326 | snd_minors[minor] = NULL; | 322 | snd_minors[minor] = NULL; |
@@ -331,15 +327,15 @@ int snd_unregister_device(int type, struct snd_card *card, int dev) | |||
331 | EXPORT_SYMBOL(snd_unregister_device); | 327 | EXPORT_SYMBOL(snd_unregister_device); |
332 | 328 | ||
333 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, | 329 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, |
334 | const struct class_device_attribute *attr) | 330 | struct device_attribute *attr) |
335 | { | 331 | { |
336 | int minor, ret = -EINVAL; | 332 | int minor, ret = -EINVAL; |
337 | struct class_device *cdev; | 333 | struct device *d; |
338 | 334 | ||
339 | mutex_lock(&sound_mutex); | 335 | mutex_lock(&sound_mutex); |
340 | minor = find_snd_minor(type, card, dev); | 336 | minor = find_snd_minor(type, card, dev); |
341 | if (minor >= 0 && (cdev = snd_minors[minor]->class_dev) != NULL) | 337 | if (minor >= 0 && (d = snd_minors[minor]->dev) != NULL) |
342 | ret = class_device_create_file(cdev, attr); | 338 | ret = device_create_file(d, attr); |
343 | mutex_unlock(&sound_mutex); | 339 | mutex_unlock(&sound_mutex); |
344 | return ret; | 340 | return ret; |
345 | 341 | ||