unsigned long seq_time = 0; /* Time for /dev/sequencer */
+extern struct class_simple *sound_class;
/*
* Table for configurable mixer volume handling
devfs_mk_cdev(MKDEV(SOUND_MAJOR, dev_list[i].minor),
S_IFCHR | dev_list[i].mode,
"sound/%s", dev_list[i].name);
+ class_simple_device_add(sound_class,
+ MKDEV(SOUND_MAJOR, dev_list[i].minor),
+ NULL, "%s", dev_list[i].name);
if (!dev_list[i].num)
continue;
dev_list[i].minor + (j*0x10)),
S_IFCHR | dev_list[i].mode,
"sound/%s%d", dev_list[i].name, j);
+ class_simple_device_add(sound_class,
+ MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
+ NULL,
+ "%s%d", dev_list[i].name, j);
}
}
for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
devfs_remove("sound/%s", dev_list[i].name);
+ class_simple_device_remove(MKDEV(SOUND_MAJOR, dev_list[i].minor));
if (!dev_list[i].num)
continue;
- for (j = 1; j < *dev_list[i].num; j++)
+ for (j = 1; j < *dev_list[i].num; j++) {
devfs_remove("sound/%s%d", dev_list[i].name, j);
+ class_simple_device_remove(MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
+ }
}
unregister_sound_special(1);
extern int msnd_pinnacle_init(void);
#endif
+struct class_simple *sound_class;
+EXPORT_SYMBOL(sound_class);
+
/*
* Low level list operator. Scan the ordered list, find a hole and
* join into it. Called with the lock asserted
devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor),
S_IFCHR | mode, s->name);
+ class_simple_device_add(sound_class, MKDEV(SOUND_MAJOR, s->unit_minor),
+ NULL, s->name+6);
return r;
fail:
spin_unlock(&sound_loader_lock);
if (p) {
devfs_remove(p->name);
+ class_simple_device_remove(MKDEV(SOUND_MAJOR, p->unit_minor));
kfree(p);
}
}
empty */
unregister_chrdev(SOUND_MAJOR, "sound");
devfs_remove("sound");
+ class_simple_destroy(sound_class);
}
static int __init init_soundcore(void)
return -EBUSY;
}
devfs_mk_dir ("sound");
+ sound_class = class_simple_create(THIS_MODULE, "sound");
+ if (IS_ERR(sound_class))
+ return PTR_ERR(sound_class);
return 0;
}