diff options
Diffstat (limited to 'drivers/s390/char/tape_class.c')
-rw-r--r-- | drivers/s390/char/tape_class.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c index 2e0d29730b67..aa7f166f4034 100644 --- a/drivers/s390/char/tape_class.c +++ b/drivers/s390/char/tape_class.c | |||
@@ -69,12 +69,9 @@ struct tape_class_device *register_tape_dev( | |||
69 | if (rc) | 69 | if (rc) |
70 | goto fail_with_cdev; | 70 | goto fail_with_cdev; |
71 | 71 | ||
72 | tcd->class_device = class_device_create( | 72 | tcd->class_device = device_create(tape_class, device, |
73 | tape_class, | 73 | tcd->char_device->dev, |
74 | NULL, | 74 | "%s", tcd->device_name |
75 | tcd->char_device->dev, | ||
76 | device, | ||
77 | "%s", tcd->device_name | ||
78 | ); | 75 | ); |
79 | rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0; | 76 | rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0; |
80 | if (rc) | 77 | if (rc) |
@@ -90,7 +87,7 @@ struct tape_class_device *register_tape_dev( | |||
90 | return tcd; | 87 | return tcd; |
91 | 88 | ||
92 | fail_with_class_device: | 89 | fail_with_class_device: |
93 | class_device_destroy(tape_class, tcd->char_device->dev); | 90 | device_destroy(tape_class, tcd->char_device->dev); |
94 | 91 | ||
95 | fail_with_cdev: | 92 | fail_with_cdev: |
96 | cdev_del(tcd->char_device); | 93 | cdev_del(tcd->char_device); |
@@ -105,11 +102,9 @@ EXPORT_SYMBOL(register_tape_dev); | |||
105 | void unregister_tape_dev(struct tape_class_device *tcd) | 102 | void unregister_tape_dev(struct tape_class_device *tcd) |
106 | { | 103 | { |
107 | if (tcd != NULL && !IS_ERR(tcd)) { | 104 | if (tcd != NULL && !IS_ERR(tcd)) { |
108 | sysfs_remove_link( | 105 | sysfs_remove_link(&tcd->class_device->kobj, |
109 | &tcd->class_device->dev->kobj, | 106 | tcd->mode_name); |
110 | tcd->mode_name | 107 | device_destroy(tape_class, tcd->char_device->dev); |
111 | ); | ||
112 | class_device_destroy(tape_class, tcd->char_device->dev); | ||
113 | cdev_del(tcd->char_device); | 108 | cdev_del(tcd->char_device); |
114 | kfree(tcd); | 109 | kfree(tcd); |
115 | } | 110 | } |