aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 978bfc1e0c6a..b781a90d6699 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1647,16 +1647,6 @@ static int sd_probe(struct device *dev)
1647 if (error) 1647 if (error)
1648 goto out_put; 1648 goto out_put;
1649 1649
1650 class_device_initialize(&sdkp->cdev);
1651 sdkp->cdev.dev = &sdp->sdev_gendev;
1652 sdkp->cdev.class = &sd_disk_class;
1653 strncpy(sdkp->cdev.class_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE);
1654
1655 if (class_device_add(&sdkp->cdev))
1656 goto out_put;
1657
1658 get_device(&sdp->sdev_gendev);
1659
1660 sdkp->device = sdp; 1650 sdkp->device = sdp;
1661 sdkp->driver = &sd_template; 1651 sdkp->driver = &sd_template;
1662 sdkp->disk = gd; 1652 sdkp->disk = gd;
@@ -1670,6 +1660,16 @@ static int sd_probe(struct device *dev)
1670 sdp->timeout = SD_MOD_TIMEOUT; 1660 sdp->timeout = SD_MOD_TIMEOUT;
1671 } 1661 }
1672 1662
1663 class_device_initialize(&sdkp->cdev);
1664 sdkp->cdev.dev = &sdp->sdev_gendev;
1665 sdkp->cdev.class = &sd_disk_class;
1666 strncpy(sdkp->cdev.class_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE);
1667
1668 if (class_device_add(&sdkp->cdev))
1669 goto out_put;
1670
1671 get_device(&sdp->sdev_gendev);
1672
1673 gd->major = sd_major((index & 0xf0) >> 4); 1673 gd->major = sd_major((index & 0xf0) >> 4);
1674 gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00); 1674 gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
1675 gd->minors = 16; 1675 gd->minors = 16;