From foo@baz Tue Apr 9 12:12:43 2002 Date: Mon, 7 Aug 2006 22:19:37 -0700 To: Greg KH From: Greg Kroah-Hartman Subject: Driver core: convert sound core to use struct device Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman --- sound/core/sound.c | 4 ++-- sound/oss/soundcard.c | 16 ++++++++-------- sound/sound_core.c | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) --- gregkh-2.6.orig/sound/core/sound.c +++ gregkh-2.6/sound/core/sound.c @@ -268,7 +268,7 @@ int snd_register_device(int type, struct snd_minors[minor] = preg; if (card) device = card->dev; - class_device_create(sound_class, NULL, MKDEV(major, minor), device, "%s", name); + device_create(sound_class, device, MKDEV(major, minor), "%s", name); mutex_unlock(&sound_mutex); return 0; @@ -305,7 +305,7 @@ int snd_unregister_device(int type, stru return -EINVAL; } - class_device_destroy(sound_class, MKDEV(major, minor)); + device_destroy(sound_class, MKDEV(major, minor)); snd_minors[minor] = NULL; mutex_unlock(&sound_mutex); --- gregkh-2.6.orig/sound/oss/soundcard.c +++ gregkh-2.6/sound/oss/soundcard.c @@ -562,17 +562,17 @@ static int __init oss_init(void) sound_dmap_flag = (dmabuf > 0 ? 1 : 0); for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { - class_device_create(sound_class, NULL, - MKDEV(SOUND_MAJOR, dev_list[i].minor), - NULL, "%s", dev_list[i].name); + device_create(sound_class, NULL, + MKDEV(SOUND_MAJOR, dev_list[i].minor), + "%s", dev_list[i].name); if (!dev_list[i].num) continue; for (j = 1; j < *dev_list[i].num; j++) - class_device_create(sound_class, NULL, - MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)), - NULL, "%s%d", dev_list[i].name, j); + device_create(sound_class, NULL, + MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)), + "%s%d", dev_list[i].name, j); } if (sound_nblocks >= 1024) @@ -586,11 +586,11 @@ static void __exit oss_cleanup(void) int i, j; for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { - class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor)); + device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor)); if (!dev_list[i].num) continue; for (j = 1; j < *dev_list[i].num; j++) - class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); + device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); } unregister_sound_special(1); --- gregkh-2.6.orig/sound/sound_core.c +++ gregkh-2.6/sound/sound_core.c @@ -170,8 +170,8 @@ static int sound_insert_unit(struct soun else sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP); - class_device_create(sound_class, NULL, MKDEV(SOUND_MAJOR, s->unit_minor), - dev, s->name+6); + device_create(sound_class, dev, MKDEV(SOUND_MAJOR, s->unit_minor), + s->name+6); return r; fail: @@ -193,7 +193,7 @@ static void sound_remove_unit(struct sou p = __sound_remove_unit(list, unit); spin_unlock(&sound_loader_lock); if (p) { - class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor)); + device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor)); kfree(p); } }