diff options
author | Hannes Reinecke <hare@suse.de> | 2017-09-20 10:18:51 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-09-26 02:03:14 +0300 |
commit | 2a8f7a0344c8b068cf4b13f1bf4bdd65b8787d04 (patch) | |
tree | f47c8b4be2bf668a3eece994a654d6a4b8e36a25 /drivers/scsi/device_handler/scsi_dh_emc.c | |
parent | b7af62a945706e32b987f1dd0cc86bb41a8210c3 (diff) | |
download | linux-2a8f7a0344c8b068cf4b13f1bf4bdd65b8787d04.tar.xz |
scsi: scsi_dh: Return SCSI_DH_XX error code from ->attach()
Rather than having each device handler implementing their own error
mapping, have the ->attach() call return a SCSI_DH_XXX error code and
implement the mapping in scsi_dh_handler_attach().
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/device_handler/scsi_dh_emc.c')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_emc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index 8654e940e1a8..6a2792f3a37e 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c @@ -490,7 +490,7 @@ static int clariion_bus_attach(struct scsi_device *sdev) h = kzalloc(sizeof(*h) , GFP_KERNEL); if (!h) - return -ENOMEM; + return SCSI_DH_NOMEM; h->lun_state = CLARIION_LUN_UNINITIALIZED; h->default_sp = CLARIION_UNBOUND_LU; h->current_sp = CLARIION_UNBOUND_LU; @@ -510,11 +510,11 @@ static int clariion_bus_attach(struct scsi_device *sdev) h->default_sp + 'A'); sdev->handler_data = h; - return 0; + return SCSI_DH_OK; failed: kfree(h); - return -EINVAL; + return err; } static void clariion_bus_detach(struct scsi_device *sdev) |