Commit 4eb7de4f authored by Ben Collins's avatar Ben Collins Committed by Linus Torvalds

[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().
parent 3ef076bb
......@@ -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.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment