diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-12-14 13:27:20 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-12-14 21:52:45 -0500 |
commit | 9e1fe9314cb5649b2dc73690f2cd8d0068e633d9 (patch) | |
tree | 14b2fb95a2f58d618c3dcb80b916958aebfeba59 /drivers/scsi/aic7xxx/aic7xxx_osm.c | |
parent | e7a1ca1d27e20ea2c0ba161c57e3c1d4112b60f7 (diff) |
[SCSI] handle scsi_add_host failure for aic7xxx and fix compiler warning
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>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm.c')
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index d866213f42b8..fd389e9f9460 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
@@ -1061,10 +1061,11 @@ uint32_t aic7xxx_verbose; | |||
1061 | int | 1061 | int |
1062 | ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *template) | 1062 | ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *template) |
1063 | { | 1063 | { |
1064 | char buf[80]; | 1064 | char buf[80]; |
1065 | struct Scsi_Host *host; | 1065 | struct Scsi_Host *host; |
1066 | char *new_name; | 1066 | char *new_name; |
1067 | u_long s; | 1067 | u_long s; |
1068 | int retval; | ||
1068 | 1069 | ||
1069 | template->name = ahc->description; | 1070 | template->name = ahc->description; |
1070 | host = scsi_host_alloc(template, sizeof(struct ahc_softc *)); | 1071 | host = scsi_host_alloc(template, sizeof(struct ahc_softc *)); |
@@ -1097,9 +1098,16 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa | |||
1097 | 1098 | ||
1098 | host->transportt = ahc_linux_transport_template; | 1099 | host->transportt = ahc_linux_transport_template; |
1099 | 1100 | ||
1100 | scsi_add_host(host, (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); /* XXX handle failure */ | 1101 | retval = scsi_add_host(host, |
1102 | (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); | ||
1103 | if (retval) { | ||
1104 | printk(KERN_WARNING "aic7xxx: scsi_add_host failed\n"); | ||
1105 | scsi_host_put(host); | ||
1106 | return retval; | ||
1107 | } | ||
1108 | |||
1101 | scsi_scan_host(host); | 1109 | scsi_scan_host(host); |
1102 | return (0); | 1110 | return 0; |
1103 | } | 1111 | } |
1104 | 1112 | ||
1105 | /* | 1113 | /* |