aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ch.c')
-rw-r--r--drivers/scsi/ch.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index 92d1cb1b21cb..75c84d7b9ce8 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@ -881,7 +881,7 @@ static long ch_ioctl_compat(struct file * file,
881static int ch_probe(struct device *dev) 881static int ch_probe(struct device *dev)
882{ 882{
883 struct scsi_device *sd = to_scsi_device(dev); 883 struct scsi_device *sd = to_scsi_device(dev);
884 struct class_device *class_dev; 884 struct device *class_dev;
885 int minor, ret = -ENOMEM; 885 int minor, ret = -ENOMEM;
886 scsi_changer *ch; 886 scsi_changer *ch;
887 887
@@ -910,11 +910,11 @@ static int ch_probe(struct device *dev)
910 ch->minor = minor; 910 ch->minor = minor;
911 sprintf(ch->name,"ch%d",ch->minor); 911 sprintf(ch->name,"ch%d",ch->minor);
912 912
913 class_dev = class_device_create(ch_sysfs_class, NULL, 913 class_dev = device_create(ch_sysfs_class, dev,
914 MKDEV(SCSI_CHANGER_MAJOR, ch->minor), 914 MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
915 dev, "s%s", ch->name); 915 "s%s", ch->name);
916 if (IS_ERR(class_dev)) { 916 if (IS_ERR(class_dev)) {
917 printk(KERN_WARNING "ch%d: class_device_create failed\n", 917 printk(KERN_WARNING "ch%d: device_create failed\n",
918 ch->minor); 918 ch->minor);
919 ret = PTR_ERR(class_dev); 919 ret = PTR_ERR(class_dev);
920 goto remove_idr; 920 goto remove_idr;
@@ -945,8 +945,7 @@ static int ch_remove(struct device *dev)
945 idr_remove(&ch_index_idr, ch->minor); 945 idr_remove(&ch_index_idr, ch->minor);
946 spin_unlock(&ch_index_lock); 946 spin_unlock(&ch_index_lock);
947 947
948 class_device_destroy(ch_sysfs_class, 948 device_destroy(ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR,ch->minor));
949 MKDEV(SCSI_CHANGER_MAJOR,ch->minor));
950 kfree(ch->dt); 949 kfree(ch->dt);
951 kfree(ch); 950 kfree(ch);
952 return 0; 951 return 0;