aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ipr.c
diff options
context:
space:
mode:
authorbrking@us.ibm.com <brking@us.ibm.com>2005-11-01 18:01:07 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-11-06 14:02:46 -0500
commit692aebfc6982a64e70ed11467545f2b9c95e6592 (patch)
tree6cb5413e8b0c42cb2b2235d60d9ca745233a0332 /drivers/scsi/ipr.c
parent0726ce26104671e3072d90b9c697c253974e823d (diff)
[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/ipr.c')
-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)
2815 * handling new commands. 2815 * handling new commands.
2816 * 2816 *
2817 * Return value: 2817 * Return value:
2818 * 0 on success 2818 * 0 on success / -ENXIO if device does not exist
2819 **/ 2819 **/
2820static int ipr_slave_alloc(struct scsi_device *sdev) 2820static int ipr_slave_alloc(struct scsi_device *sdev)
2821{ 2821{
2822 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata; 2822 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata;
2823 struct ipr_resource_entry *res; 2823 struct ipr_resource_entry *res;
2824 unsigned long lock_flags; 2824 unsigned long lock_flags;
2825 int rc = -ENXIO;
2825 2826
2826 sdev->hostdata = NULL; 2827 sdev->hostdata = NULL;
2827 2828
@@ -2836,13 +2837,14 @@ static int ipr_slave_alloc(struct scsi_device *sdev)
2836 res->in_erp = 0; 2837 res->in_erp = 0;
2837 sdev->hostdata = res; 2838 sdev->hostdata = res;
2838 res->needs_sync_complete = 1; 2839 res->needs_sync_complete = 1;
2840 rc = 0;
2839 break; 2841 break;
2840 } 2842 }
2841 } 2843 }
2842 2844
2843 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 2845 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2844 2846
2845 return 0; 2847 return rc;
2846} 2848}
2847 2849
2848/** 2850/**