summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorbrking@us.ibm.com <brking@us.ibm.com>2005-11-02 00:01:07 +0100
committerJames Bottomley <jejb@mulgrave.(none)>2005-11-06 20:02:46 +0100
commit692aebfc6982a64e70ed11467545f2b9c95e6592 (patch)
tree6cb5413e8b0c42cb2b2235d60d9ca745233a0332 /drivers/scsi
parent[SCSI] ipr: Prevent upper layer driver binding (diff)
downloadlinux-692aebfc6982a64e70ed11467545f2b9c95e6592.tar.xz
linux-692aebfc6982a64e70ed11467545f2b9c95e6592.zip
[SCSI] ipr: slave_alloc optimization
Optimize ipr's slave_alloc to return -ENXIO for devices that do not exist. Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ipr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 63d01e6394a2..8817ea06adbf 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -2815,13 +2815,14 @@ static int ipr_slave_configure(struct scsi_device *sdev)
* handling new commands.
*
* Return value:
- * 0 on success
+ * 0 on success / -ENXIO if device does not exist
**/
static int ipr_slave_alloc(struct scsi_device *sdev)
{
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata;
struct ipr_resource_entry *res;
unsigned long lock_flags;
+ int rc = -ENXIO;
sdev->hostdata = NULL;
@@ -2836,13 +2837,14 @@ static int ipr_slave_alloc(struct scsi_device *sdev)
res->in_erp = 0;
sdev->hostdata = res;
res->needs_sync_complete = 1;
+ rc = 0;
break;
}
}
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
- return 0;
+ return rc;
}
/**