mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Su Hui <suhui@nfschina.com>
To: dan.carpenter@linaro.org, hare@suse.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com
Cc: Su Hui <suhui@nfschina.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [PATCH v2 3/3] scsi: aic7xxx: return negative error codes in aic7770_probe()
Date: Fri,  1 Dec 2023 10:59:56 +0800	[thread overview]
Message-ID: <20231201025955.1584260-4-suhui@nfschina.com> (raw)
In-Reply-To: <20231201025955.1584260-1-suhui@nfschina.com>

aic7770_config() returns both negative and positive error code.
it's better to make aic7770_probe() only return negative error codes.

And the previous patch 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>
---
 drivers/scsi/aic7xxx/aic7770_osm.c | 6 +++---
 1 file 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);
-- 
2.30.2


  parent reply	other threads:[~2023-12-01  3:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01  2:59 [PATCH v2 0/3] scsi: aic7xxx: fix some problem of return value Su Hui
2023-12-01  2:59 ` [PATCH v2 1/3] scsi: aic7xxx: return negative error codes in ahc_linux_register_host() Su Hui
2023-12-01  2:59 ` [PATCH v2 2/3] scsi: aic7xxx: return ahc_linux_register_host()'s value rather than zero Su Hui
2023-12-01  2:59 ` Su Hui [this message]
2023-12-03 10:34   ` [PATCH v2 3/3] scsi: aic7xxx: return negative error codes in aic7770_probe() Christophe JAILLET
2023-12-03 10:36     ` Marion & Christophe JAILLET
2023-12-01  7:53 ` [PATCH v2 0/3] scsi: aic7xxx: fix some problem of return value Dan Carpenter
2023-12-05  3:33   ` Su Hui
2023-12-05  8:14     ` Dan Carpenter
2023-12-05  8:28       ` Su Hui
2023-12-06  2:18 ` Martin K. Petersen
2023-12-14  4:29 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231201025955.1584260-4-suhui@nfschina.com \
    --to=suhui@nfschina.com \
    --cc=dan.carpenter@linaro.org \
    --cc=hare@suse.com \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®