提交 e7a1ca1d 编写于 作者: J Jesper Juhl 提交者: James Bottomley

[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: NJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 829b8467
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册