X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fs390%2Fchar%2Ftape_class.c;h=6dfdb7c179819a121e8514db89daf6eb35811f8c;hb=c74c120a21d87b0b6925ada5830d8cac21e852d9;hp=56b87618b100c1d33b8829d3f9bd184f7c80f7b6;hpb=0a7d5f8ce960e74fa22986bda4af488539796e49;p=linux-2.6 diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c index 56b87618b1..6dfdb7c179 100644 --- a/drivers/s390/char/tape_class.c +++ b/drivers/s390/char/tape_class.c @@ -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,12 +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(tape_class, device, + tcd->char_device->dev, + "%s", tcd->device_name ); rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0; if (rc) @@ -90,7 +87,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 +99,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); }