diff options
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 4284625ed035..cee1e4c6d83c 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1451,17 +1451,18 @@ sg_add(struct device *cl_dev, struct class_interface *cl_intf) | |||
1451 | if (sg_sysfs_valid) { | 1451 | if (sg_sysfs_valid) { |
1452 | struct device *sg_class_member; | 1452 | struct device *sg_class_member; |
1453 | 1453 | ||
1454 | sg_class_member = device_create(sg_sysfs_class, cl_dev->parent, | 1454 | sg_class_member = device_create_drvdata(sg_sysfs_class, |
1455 | MKDEV(SCSI_GENERIC_MAJOR, | 1455 | cl_dev->parent, |
1456 | sdp->index), | 1456 | MKDEV(SCSI_GENERIC_MAJOR, |
1457 | "%s", disk->disk_name); | 1457 | sdp->index), |
1458 | sdp, | ||
1459 | "%s", disk->disk_name); | ||
1458 | if (IS_ERR(sg_class_member)) { | 1460 | if (IS_ERR(sg_class_member)) { |
1459 | printk(KERN_ERR "sg_add: " | 1461 | printk(KERN_ERR "sg_add: " |
1460 | "device_create failed\n"); | 1462 | "device_create failed\n"); |
1461 | error = PTR_ERR(sg_class_member); | 1463 | error = PTR_ERR(sg_class_member); |
1462 | goto cdev_add_err; | 1464 | goto cdev_add_err; |
1463 | } | 1465 | } |
1464 | dev_set_drvdata(sg_class_member, sdp); | ||
1465 | error = sysfs_create_link(&scsidp->sdev_gendev.kobj, | 1466 | error = sysfs_create_link(&scsidp->sdev_gendev.kobj, |
1466 | &sg_class_member->kobj, "generic"); | 1467 | &sg_class_member->kobj, "generic"); |
1467 | if (error) | 1468 | if (error) |