summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSu Hui <suhui@nfschina.com>2023-12-01 03:59:56 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2023-12-06 03:18:40 +0100
commitaef6ac123609c4365f0270ec689ef215d13c3061 (patch)
treed62ced0aa2790be7f1e2d60478dd33283f45d118
parentscsi: aic7xxx: Return ahc_linux_register_host()'s value rather than zero (diff)
downloadlinux-aef6ac123609c4365f0270ec689ef215d13c3061.tar.xz
linux-aef6ac123609c4365f0270ec689ef215d13c3061.zip
scsi: aic7xxx: Return negative error codes in aic7770_probe()
aic7770_config() returns both negative and positive error codes. It's better to make aic7770_probe() only return negative error codes. A previous commit made ahc_linux_register_host() return negative error codes, which makes sure aic7770_probe() returns negative error codes. Signed-off-by: Su Hui <suhui@nfschina.com> Link: https://lore.kernel.org/r/20231201025955.1584260-4-suhui@nfschina.com Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/aic7xxx/aic7770_osm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c
index bdd177e3d762..a19cdd87c453 100644
--- a/drivers/scsi/aic7xxx/aic7770_osm.c
+++ b/drivers/scsi/aic7xxx/aic7770_osm.c
@@ -87,17 +87,17 @@ aic7770_probe(struct device *dev)
sprintf(buf, "ahc_eisa:%d", eisaBase >> 12);
name = kstrdup(buf, GFP_ATOMIC);
if (name == NULL)
- return (ENOMEM);
+ return -ENOMEM;
ahc = ahc_alloc(&aic7xxx_driver_template, name);
if (ahc == NULL)
- return (ENOMEM);
+ return -ENOMEM;
ahc->dev = dev;
error = aic7770_config(ahc, aic7770_ident_table + edev->id.driver_data,
eisaBase);
if (error != 0) {
ahc->bsh.ioport = 0;
ahc_free(ahc);
- return (error);
+ return error < 0 ? error : -error;
}
dev_set_drvdata(dev, ahc);