aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index c9d7f721b9e2..ea0edd1b2e76 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1441,17 +1441,18 @@ sg_add(struct device *cl_dev, struct class_interface *cl_intf)
1441 if (sg_sysfs_valid) { 1441 if (sg_sysfs_valid) {
1442 struct device *sg_class_member; 1442 struct device *sg_class_member;
1443 1443
1444 sg_class_member = device_create(sg_sysfs_class, cl_dev->parent, 1444 sg_class_member = device_create_drvdata(sg_sysfs_class,
1445 MKDEV(SCSI_GENERIC_MAJOR, 1445 cl_dev->parent,
1446 sdp->index), 1446 MKDEV(SCSI_GENERIC_MAJOR,
1447 "%s", disk->disk_name); 1447 sdp->index),
1448 sdp,
1449 "%s", disk->disk_name);
1448 if (IS_ERR(sg_class_member)) { 1450 if (IS_ERR(sg_class_member)) {
1449 printk(KERN_ERR "sg_add: " 1451 printk(KERN_ERR "sg_add: "
1450 "device_create failed\n"); 1452 "device_create failed\n");
1451 error = PTR_ERR(sg_class_member); 1453 error = PTR_ERR(sg_class_member);
1452 goto cdev_add_err; 1454 goto cdev_add_err;
1453 } 1455 }
1454 dev_set_drvdata(sg_class_member, sdp);
1455 error = sysfs_create_link(&scsidp->sdev_gendev.kobj, 1456 error = sysfs_create_link(&scsidp->sdev_gendev.kobj,
1456 &sg_class_member->kobj, "generic"); 1457 &sg_class_member->kobj, "generic");
1457 if (error) 1458 if (error)