]> err.no Git - linux-2.6/commitdiff
[SCSI] scsi: handle ->slave_configure return value
authorChristoph Hellwig <hch@lst.de>
Fri, 17 Feb 2006 11:11:29 +0000 (12:11 +0100)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Tue, 28 Feb 2006 03:26:45 +0000 (21:26 -0600)
When ­>slave_configure fails the scsi midlayer should handle it.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/scsi_scan.c

index 5acb83ca5ae535edfb3938395e0b53d67a5a41cf..f9ecc3dea7dfaf9643ac0bbb90e45a816be7cf80 100644 (file)
@@ -752,8 +752,20 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
 
        transport_configure_device(&sdev->sdev_gendev);
 
-       if (sdev->host->hostt->slave_configure)
-               sdev->host->hostt->slave_configure(sdev);
+       if (sdev->host->hostt->slave_configure) {
+               int ret = sdev->host->hostt->slave_configure(sdev);
+               if (ret) {
+                       /*
+                        * if LLDD reports slave not present, don't clutter
+                        * console with alloc failure messages
+                        */
+                       if (ret != -ENXIO) {
+                               sdev_printk(KERN_ERR, sdev,
+                                       "failed to configure device\n");
+                       }
+                       return SCSI_SCAN_NO_RESPONSE;
+               }
+       }
 
        /*
         * Ok, the device is now all set up, we can