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

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.com


Reviewed-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 70dfaf84
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);