]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/char/tape_class.c
device create: s390: convert device_create to device_create_drvdata
[linux-2.6-omap-h63xx.git] / drivers / s390 / char / tape_class.c
index 56b87618b100c1d33b8829d3f9bd184f7c80f7b6..12c2a5aaf31b47e88587957b7f31cb6a24edff7b 100644 (file)
@@ -36,7 +36,7 @@ static struct class *tape_class;
 struct tape_class_device *register_tape_dev(
        struct device *         device,
        dev_t                   dev,
-       struct file_operations *fops,
+       const struct file_operations *fops,
        char *                  device_name,
        char *                  mode_name)
 {
@@ -69,13 +69,9 @@ struct tape_class_device *register_tape_dev(
        if (rc)
                goto fail_with_cdev;
 
-       tcd->class_device = class_device_create(
-                               tape_class,
-                               NULL,
-                               tcd->char_device->dev,
-                               device,
-                               "%s", tcd->device_name
-                       );
+       tcd->class_device = device_create_drvdata(tape_class, device,
+                                                 tcd->char_device->dev,
+                                                 NULL, "%s", tcd->device_name);
        rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0;
        if (rc)
                goto fail_with_cdev;
@@ -90,7 +86,7 @@ struct tape_class_device *register_tape_dev(
        return tcd;
 
 fail_with_class_device:
-       class_device_destroy(tape_class, tcd->char_device->dev);
+       device_destroy(tape_class, tcd->char_device->dev);
 
 fail_with_cdev:
        cdev_del(tcd->char_device);
@@ -102,14 +98,11 @@ fail_with_tcd:
 }
 EXPORT_SYMBOL(register_tape_dev);
 
-void unregister_tape_dev(struct tape_class_device *tcd)
+void unregister_tape_dev(struct device *device, struct tape_class_device *tcd)
 {
        if (tcd != NULL && !IS_ERR(tcd)) {
-               sysfs_remove_link(
-                       &tcd->class_device->dev->kobj,
-                       tcd->mode_name
-               );
-               class_device_destroy(tape_class, tcd->char_device->dev);
+               sysfs_remove_link(&device->kobj, tcd->mode_name);
+               device_destroy(tape_class, tcd->char_device->dev);
                cdev_del(tcd->char_device);
                kfree(tcd);
        }