linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / char / dsp56k.c
index 9b1bf60..e233cf2 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/init.h>
+#include <linux/devfs_fs_kernel.h>
 #include <linux/smp_lock.h>
 #include <linux/device.h>
 
@@ -483,7 +484,7 @@ static int dsp56k_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static const struct file_operations dsp56k_fops = {
+static struct file_operations dsp56k_fops = {
        .owner          = THIS_MODULE,
        .read           = dsp56k_read,
        .write          = dsp56k_write,
@@ -517,9 +518,17 @@ static int __init dsp56k_init_driver(void)
        }
        class_device_create(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k");
 
+       err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0),
+                     S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k");
+       if(err)
+               goto out_class;
+
        printk(banner);
        goto out;
 
+out_class:
+       class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
+       class_destroy(dsp56k_class);
 out_chrdev:
        unregister_chrdev(DSP56K_MAJOR, "dsp56k");
 out:
@@ -532,6 +541,7 @@ static void __exit dsp56k_cleanup_driver(void)
        class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
        class_destroy(dsp56k_class);
        unregister_chrdev(DSP56K_MAJOR, "dsp56k");
+       devfs_remove("dsp56k");
 }
 module_exit(dsp56k_cleanup_driver);