]> err.no Git - linux-2.6/blobdiff - drivers/char/stallion.c
Merge master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6] / drivers / char / stallion.c
index b8899f560b5ecd85dd17f86affdf1f0638c0fa4d..95af2a941595517ca0ea30daa4a380a739724475 100644 (file)
@@ -719,7 +719,7 @@ static struct file_operations       stl_fsiomem = {
 
 /*****************************************************************************/
 
-static struct class_simple *stallion_class;
+static struct class *stallion_class;
 
 /*
  *     Loadable module initialization stuff.
@@ -777,16 +777,15 @@ static void __exit stallion_module_exit(void)
        }
        for (i = 0; i < 4; i++) {
                devfs_remove("staliomem/%d", i);
-               class_simple_device_remove(MKDEV(STL_SIOMEMMAJOR, i));
+               class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
        }
        devfs_remove("staliomem");
        if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
                printk("STALLION: failed to un-register serial memory device, "
                        "errno=%d\n", -i);
-       class_simple_destroy(stallion_class);
+       class_destroy(stallion_class);
 
-       if (stl_tmpwritebuf != (char *) NULL)
-               kfree(stl_tmpwritebuf);
+       kfree(stl_tmpwritebuf);
 
        for (i = 0; (i < stl_nrbrds); i++) {
                if ((brdp = stl_brds[i]) == (stlbrd_t *) NULL)
@@ -804,8 +803,7 @@ static void __exit stallion_module_exit(void)
                                        continue;
                                if (portp->tty != (struct tty_struct *) NULL)
                                        stl_hangup(portp->tty);
-                               if (portp->tx.buf != (char *) NULL)
-                                       kfree(portp->tx.buf);
+                               kfree(portp->tx.buf);
                                kfree(portp);
                        }
                        kfree(panelp);
@@ -3090,12 +3088,14 @@ static int __init stl_init(void)
                printk("STALLION: failed to register serial board device\n");
        devfs_mk_dir("staliomem");
 
-       stallion_class = class_simple_create(THIS_MODULE, "staliomem");
+       stallion_class = class_create(THIS_MODULE, "staliomem");
        for (i = 0; i < 4; i++) {
                devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
                                S_IFCHR|S_IRUSR|S_IWUSR,
                                "staliomem/%d", i);
-               class_simple_device_add(stallion_class, MKDEV(STL_SIOMEMMAJOR, i), NULL, "staliomem%d", i);
+               class_device_create(stallion_class, NULL,
+                                   MKDEV(STL_SIOMEMMAJOR, i), NULL,
+                                   "staliomem%d", i);
        }
 
        stl_serial->owner = THIS_MODULE;