* [PATCH] handle scsi_add_host failure for aic7xxx and fix compiler warning
@ 2005-12-14 18:27 Jesper Juhl
0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2005-12-14 18:27 UTC (permalink / raw)
To: James Bottomley
Cc: Linux Kernel Mailing List, linux-scsi, Daniel M. Eischen, Doug Ledford
Add scsi_add_host() failure handling for aic7xxx
Also silence a compiler warning :
drivers/scsi/aic7xxx/aic7xxx_osm.c: In function `ahc_linux_register_host':
drivers/scsi/aic7xxx/aic7xxx_osm.c:1100: warning: ignoring return value of `scsi_add_host', declared with attribute warn_unused_result
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
drivers/scsi/aic7xxx/aic7xxx_osm.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
--- linux-2.6.15-rc5-git3-orig/drivers/scsi/aic7xxx/aic7xxx_osm.c 2005-12-04 18:48:12.000000000 +0100
+++ linux-2.6.15-rc5-git3/drivers/scsi/aic7xxx/aic7xxx_osm.c 2005-12-14 19:13:58.000000000 +0100
@@ -1061,10 +1061,11 @@ uint32_t aic7xxx_verbose;
int
ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *template)
{
- char buf[80];
- struct Scsi_Host *host;
+ char buf[80];
+ struct Scsi_Host *host;
char *new_name;
- u_long s;
+ u_long s;
+ int retval;
template->name = ahc->description;
host = scsi_host_alloc(template, sizeof(struct ahc_softc *));
@@ -1097,9 +1098,16 @@ ahc_linux_register_host(struct ahc_softc
host->transportt = ahc_linux_transport_template;
- scsi_add_host(host, (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); /* XXX handle failure */
+ retval = scsi_add_host(host,
+ (ahc->dev_softc ? &ahc->dev_softc->dev : NULL));
+ if (retval) {
+ printk(KERN_WARNING "aic7xxx: scsi_add_host failed\n");
+ scsi_host_put(host);
+ return retval;
+ }
+
scsi_scan_host(host);
- return (0);
+ return 0;
}
/*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-12-14 18:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-14 18:27 [PATCH] handle scsi_add_host failure for aic7xxx and fix compiler warning Jesper Juhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome