diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-12-03 16:41:36 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-01-02 11:22:16 -0500 |
commit | 71610f55fa4db63dbf5385929a47c9fb2451f332 (patch) | |
tree | b816672eef25e1436111e6c78053612bd22fb016 /drivers/scsi/scsi_sysfs.c | |
parent | b58602a4bac012b5f4fc12fe6b46ab237b610d5d (diff) |
[SCSI] struct device - replace bus_id with dev_name(), dev_set_name()
[jejb: limit ioctl to returning 20 characters to avoid overrun
on long device names and add a few more conversions]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 93c28f30bbd7..da63802cbf9d 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -1079,16 +1079,14 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev) | |||
1079 | device_initialize(&sdev->sdev_gendev); | 1079 | device_initialize(&sdev->sdev_gendev); |
1080 | sdev->sdev_gendev.bus = &scsi_bus_type; | 1080 | sdev->sdev_gendev.bus = &scsi_bus_type; |
1081 | sdev->sdev_gendev.type = &scsi_dev_type; | 1081 | sdev->sdev_gendev.type = &scsi_dev_type; |
1082 | sprintf(sdev->sdev_gendev.bus_id,"%d:%d:%d:%d", | 1082 | dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%d", |
1083 | sdev->host->host_no, sdev->channel, sdev->id, | 1083 | sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); |
1084 | sdev->lun); | 1084 | |
1085 | |||
1086 | device_initialize(&sdev->sdev_dev); | 1085 | device_initialize(&sdev->sdev_dev); |
1087 | sdev->sdev_dev.parent = &sdev->sdev_gendev; | 1086 | sdev->sdev_dev.parent = &sdev->sdev_gendev; |
1088 | sdev->sdev_dev.class = &sdev_class; | 1087 | sdev->sdev_dev.class = &sdev_class; |
1089 | snprintf(sdev->sdev_dev.bus_id, BUS_ID_SIZE, | 1088 | dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%d", |
1090 | "%d:%d:%d:%d", sdev->host->host_no, | 1089 | sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); |
1091 | sdev->channel, sdev->id, sdev->lun); | ||
1092 | sdev->scsi_level = starget->scsi_level; | 1090 | sdev->scsi_level = starget->scsi_level; |
1093 | transport_setup_device(&sdev->sdev_gendev); | 1091 | transport_setup_device(&sdev->sdev_gendev); |
1094 | spin_lock_irqsave(shost->host_lock, flags); | 1092 | spin_lock_irqsave(shost->host_lock, flags); |