aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorgregkh@suse.de <gregkh@suse.de>2005-03-23 12:51:41 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:07 -0400
commit619e666b7e9d2b0545ab60a9c824ae5f77c20c3b (patch)
treea2c6d9bb6b8f66fdda8cc6cd8422f062e557922d /sound
parent8561b10f6e7ef0a085709ffc844f74130a067abe (diff)
[PATCH] class: convert sound/* to use the new class api instead of class_simple
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/sound.c6
-rw-r--r--sound/oss/soundcard.c19
-rw-r--r--sound/sound_core.c10
3 files changed, 17 insertions, 18 deletions
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 88e052079f85..33eaa5e5d284 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -64,7 +64,7 @@ static struct list_head snd_minors_hash[SNDRV_CARDS];
64 64
65static DECLARE_MUTEX(sound_mutex); 65static DECLARE_MUTEX(sound_mutex);
66 66
67extern struct class_simple *sound_class; 67extern struct class *sound_class;
68 68
69 69
70#ifdef CONFIG_KMOD 70#ifdef CONFIG_KMOD
@@ -231,7 +231,7 @@ int snd_register_device(int type, snd_card_t * card, int dev, snd_minor_t * reg,
231 devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name); 231 devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name);
232 if (card) 232 if (card)
233 device = card->dev; 233 device = card->dev;
234 class_simple_device_add(sound_class, MKDEV(major, minor), device, name); 234 class_device_create(sound_class, MKDEV(major, minor), device, "%s", name);
235 235
236 up(&sound_mutex); 236 up(&sound_mutex);
237 return 0; 237 return 0;
@@ -263,7 +263,7 @@ int snd_unregister_device(int type, snd_card_t * card, int dev)
263 263
264 if (strncmp(mptr->name, "controlC", 8) || card->number >= cards_limit) /* created in sound.c */ 264 if (strncmp(mptr->name, "controlC", 8) || card->number >= cards_limit) /* created in sound.c */
265 devfs_remove("snd/%s", mptr->name); 265 devfs_remove("snd/%s", mptr->name);
266 class_simple_device_remove(MKDEV(major, minor)); 266 class_device_destroy(sound_class, MKDEV(major, minor));
267 267
268 list_del(&mptr->list); 268 list_del(&mptr->list);
269 up(&sound_mutex); 269 up(&sound_mutex);
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index de91c90a0112..a686be936aff 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -73,7 +73,7 @@ static char dma_alloc_map[MAX_DMA_CHANNELS];
73 73
74 74
75unsigned long seq_time = 0; /* Time for /dev/sequencer */ 75unsigned long seq_time = 0; /* Time for /dev/sequencer */
76extern struct class_simple *sound_class; 76extern struct class *sound_class;
77 77
78/* 78/*
79 * Table for configurable mixer volume handling 79 * Table for configurable mixer volume handling
@@ -567,9 +567,9 @@ static int __init oss_init(void)
567 devfs_mk_cdev(MKDEV(SOUND_MAJOR, dev_list[i].minor), 567 devfs_mk_cdev(MKDEV(SOUND_MAJOR, dev_list[i].minor),
568 S_IFCHR | dev_list[i].mode, 568 S_IFCHR | dev_list[i].mode,
569 "sound/%s", dev_list[i].name); 569 "sound/%s", dev_list[i].name);
570 class_simple_device_add(sound_class, 570 class_device_create(sound_class,
571 MKDEV(SOUND_MAJOR, dev_list[i].minor), 571 MKDEV(SOUND_MAJOR, dev_list[i].minor),
572 NULL, "%s", dev_list[i].name); 572 NULL, "%s", dev_list[i].name);
573 573
574 if (!dev_list[i].num) 574 if (!dev_list[i].num)
575 continue; 575 continue;
@@ -579,10 +579,9 @@ static int __init oss_init(void)
579 dev_list[i].minor + (j*0x10)), 579 dev_list[i].minor + (j*0x10)),
580 S_IFCHR | dev_list[i].mode, 580 S_IFCHR | dev_list[i].mode,
581 "sound/%s%d", dev_list[i].name, j); 581 "sound/%s%d", dev_list[i].name, j);
582 class_simple_device_add(sound_class, 582 class_device_create(sound_class,
583 MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)), 583 MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
584 NULL, 584 NULL, "%s%d", dev_list[i].name, j);
585 "%s%d", dev_list[i].name, j);
586 } 585 }
587 } 586 }
588 587
@@ -598,12 +597,12 @@ static void __exit oss_cleanup(void)
598 597
599 for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { 598 for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
600 devfs_remove("sound/%s", dev_list[i].name); 599 devfs_remove("sound/%s", dev_list[i].name);
601 class_simple_device_remove(MKDEV(SOUND_MAJOR, dev_list[i].minor)); 600 class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor));
602 if (!dev_list[i].num) 601 if (!dev_list[i].num)
603 continue; 602 continue;
604 for (j = 1; j < *dev_list[i].num; j++) { 603 for (j = 1; j < *dev_list[i].num; j++) {
605 devfs_remove("sound/%s%d", dev_list[i].name, j); 604 devfs_remove("sound/%s%d", dev_list[i].name, j);
606 class_simple_device_remove(MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); 605 class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
607 } 606 }
608 } 607 }
609 608
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 30f75c9288cb..21a69e096225 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -65,7 +65,7 @@ extern int msnd_classic_init(void);
65extern int msnd_pinnacle_init(void); 65extern int msnd_pinnacle_init(void);
66#endif 66#endif
67 67
68struct class_simple *sound_class; 68struct class *sound_class;
69EXPORT_SYMBOL(sound_class); 69EXPORT_SYMBOL(sound_class);
70 70
71/* 71/*
@@ -174,7 +174,7 @@ static int sound_insert_unit(struct sound_unit **list, struct file_operations *f
174 174
175 devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor), 175 devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor),
176 S_IFCHR | mode, s->name); 176 S_IFCHR | mode, s->name);
177 class_simple_device_add(sound_class, MKDEV(SOUND_MAJOR, s->unit_minor), 177 class_device_create(sound_class, MKDEV(SOUND_MAJOR, s->unit_minor),
178 NULL, s->name+6); 178 NULL, s->name+6);
179 return r; 179 return r;
180 180
@@ -198,7 +198,7 @@ static void sound_remove_unit(struct sound_unit **list, int unit)
198 spin_unlock(&sound_loader_lock); 198 spin_unlock(&sound_loader_lock);
199 if (p) { 199 if (p) {
200 devfs_remove(p->name); 200 devfs_remove(p->name);
201 class_simple_device_remove(MKDEV(SOUND_MAJOR, p->unit_minor)); 201 class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor));
202 kfree(p); 202 kfree(p);
203 } 203 }
204} 204}
@@ -562,7 +562,7 @@ static void __exit cleanup_soundcore(void)
562 empty */ 562 empty */
563 unregister_chrdev(SOUND_MAJOR, "sound"); 563 unregister_chrdev(SOUND_MAJOR, "sound");
564 devfs_remove("sound"); 564 devfs_remove("sound");
565 class_simple_destroy(sound_class); 565 class_destroy(sound_class);
566} 566}
567 567
568static int __init init_soundcore(void) 568static int __init init_soundcore(void)
@@ -572,7 +572,7 @@ static int __init init_soundcore(void)
572 return -EBUSY; 572 return -EBUSY;
573 } 573 }
574 devfs_mk_dir ("sound"); 574 devfs_mk_dir ("sound");
575 sound_class = class_simple_create(THIS_MODULE, "sound"); 575 sound_class = class_create(THIS_MODULE, "sound");
576 if (IS_ERR(sound_class)) 576 if (IS_ERR(sound_class))
577 return PTR_ERR(sound_class); 577 return PTR_ERR(sound_class);
578 578