summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandra Seetharaman <sekharan@us.ibm.com>2009-09-11 10:20:35 -0700
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 12:01:29 -0600
commit5917290ce9b376866b165d02a5ed88d5ecdb32d0 (patch)
treec659dcfa0b5e8fecb14484f24bc55c8e104b6300
parentcd7560cb69489c6b798b61897449989b4e972327 (diff)
[SCSI] scsi_dh: create sysfs file, dh_state for all SCSI disk devices
Create the sysfs file, dh_state even if the new SCSI device is not in the any of the device handler's internal lists. Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/device_handler/scsi_dh.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c
index 6f7f798910e8..e19a1a55270c 100644
--- a/drivers/scsi/device_handler/scsi_dh.c
+++ b/drivers/scsi/device_handler/scsi_dh.c
@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notifier_block *nb,
sdev = to_scsi_device(dev);
if (action == BUS_NOTIFY_ADD_DEVICE) {
+ err = device_create_file(dev, &scsi_dh_state_attr);
+ /* don't care about err */
devinfo = device_handler_match(NULL, sdev);
- if (!devinfo)
- goto out;
-
- err = scsi_dh_handler_attach(sdev, devinfo);
- if (!err)
- err = device_create_file(dev, &scsi_dh_state_attr);
+ if (devinfo)
+ err = scsi_dh_handler_attach(sdev, devinfo);
} else if (action == BUS_NOTIFY_DEL_DEVICE) {
device_remove_file(dev, &scsi_dh_state_attr);
scsi_dh_handler_detach(sdev, NULL);
}
-out:
return err;
}