Commit aef6ac12 authored by Su Hui's avatar Su Hui Committed by Martin K. Petersen

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: default avatarSu Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20231201025955.1584260-4-suhui@nfschina.comReviewed-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 70dfaf84
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment