diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-12-14 19:27:28 +0100 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-12-14 18:52:24 -0800 |
commit | e7a1ca1d27e20ea2c0ba161c57e3c1d4112b60f7 (patch) | |
tree | 69a919a9d6d07b1ebb9dbb836b3d20bd78afb52e /drivers | |
parent | 829b84675edbe05f11c289946216da4f5c6b8e94 (diff) | |
download | linux-3.10-e7a1ca1d27e20ea2c0ba161c57e3c1d4112b60f7.tar.gz linux-3.10-e7a1ca1d27e20ea2c0ba161c57e3c1d4112b60f7.tar.bz2 linux-3.10-e7a1ca1d27e20ea2c0ba161c57e3c1d4112b60f7.zip |
[SCSI] handle scsi_add_host failure for aic79xx and fix compiler warning
Add scsi_add_host() failure handling for aic79xx
Also silence a compiler warning :
drivers/scsi/aic7xxx/aic79xx_osm.c: In function `ahd_linux_register_host':
drivers/scsi/aic7xxx/aic79xx_osm.c:1099: warning: ignoring return value of `scsi_add_host', declared with attribute warn_unused_result
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 6aab9dacdee..1c8f872e2dd 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -1064,6 +1064,7 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa struct Scsi_Host *host; char *new_name; u_long s; + int retval; template->name = ahd->description; host = scsi_host_alloc(template, sizeof(struct ahd_softc *)); @@ -1096,9 +1097,15 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa host->transportt = ahd_linux_transport_template; - scsi_add_host(host, &ahd->dev_softc->dev); /* XXX handle failure */ + retval = scsi_add_host(host, &ahd->dev_softc->dev); + if (retval) { + printk(KERN_WARNING "aic79xx: scsi_add_host failed\n"); + scsi_host_put(host); + return retval; + } + scsi_scan_host(host); - return (0); + return 0; } uint64_t |