Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Collins <bcollins@debian.org>2003-06-13 04:27:42 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-06-13 04:27:42 -0700
commit4eb7de4fdb22ecb6cf1870cf22d28b70f7940cf1 (patch)
tree3db8e209a59426ec7de1b6538cf2daef3231a1ef
parent3ef076bb685a461bbaff37a1f06010fc4d7ce733 (diff)
[PATCH] Register scsi devices after naming them
scsi_add_lun doesn't set sdp->devfs_name before calling scsi_register_device(). Since scsi_register_device calls down to things like sd_probe, which do try to use sdp->devfs_name, things fail. Just an easy change, moving the sdp->devfs_name creation before calling scsi_register_device().
-rw-r--r--drivers/scsi/scsi_scan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index d4dcd6f1239b..947b99663d02 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -619,12 +619,12 @@ static int scsi_add_lun(Scsi_Device *sdev, char *inq_result, int *bflags)
if (inq_result[7] & 0x10)
sdev->sdtr = 1;
- scsi_device_register(sdev);
-
sprintf(sdev->devfs_name, "scsi/host%d/bus%d/target%d/lun%d",
sdev->host->host_no, sdev->channel,
sdev->id, sdev->lun);
+ scsi_device_register(sdev);
+
/*
* End driverfs/devfs code.
*/