diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh.c | 11 |
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, | |||
304 | sdev = to_scsi_device(dev); | 304 | sdev = to_scsi_device(dev); |
305 | 305 | ||
306 | if (action == BUS_NOTIFY_ADD_DEVICE) { | 306 | if (action == BUS_NOTIFY_ADD_DEVICE) { |
307 | err = device_create_file(dev, &scsi_dh_state_attr); | ||
308 | /* don't care about err */ | ||
307 | devinfo = device_handler_match(NULL, sdev); | 309 | devinfo = device_handler_match(NULL, sdev); |
308 | if (!devinfo) | 310 | if (devinfo) |
309 | goto out; | 311 | err = scsi_dh_handler_attach(sdev, devinfo); |
310 | |||
311 | err = scsi_dh_handler_attach(sdev, devinfo); | ||
312 | if (!err) | ||
313 | err = device_create_file(dev, &scsi_dh_state_attr); | ||
314 | } else if (action == BUS_NOTIFY_DEL_DEVICE) { | 312 | } else if (action == BUS_NOTIFY_DEL_DEVICE) { |
315 | device_remove_file(dev, &scsi_dh_state_attr); | 313 | device_remove_file(dev, &scsi_dh_state_attr); |
316 | scsi_dh_handler_detach(sdev, NULL); | 314 | scsi_dh_handler_detach(sdev, NULL); |
317 | } | 315 | } |
318 | out: | ||
319 | return err; | 316 | return err; |
320 | } | 317 | } |
321 | 318 | ||