From: Zheyu Ma <zheyuma97@gmail.com>
To: damien.lemoal@opensource.wdc.com
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
Zheyu Ma <zheyuma97@gmail.com>
Subject: [PATCH] ata: sata_mv: Fix the return value of the probe function
Date: Thu, 21 Oct 2021 05:57:16 +0000 [thread overview]
Message-ID: <1634795836-1803-1-git-send-email-zheyuma97@gmail.com> (raw)
mv_init_host() propagates the value returned by mv_chip_id() which in turn
gets propagated by mv_pci_init_one() and hits local_pci_probe().
During the process of driver probing, the probe function should return < 0
for failure, otherwise, the kernel will treat value > 0 as success.
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
drivers/ata/sata_mv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 9d86203e1e7a..7461fe078dd1 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -3897,7 +3897,7 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
default:
dev_err(host->dev, "BUG: invalid board index %u\n", board_idx);
- return 1;
+ return -ENODEV;
}
hpriv->hp_flags = hp_flags;
--
2.17.6
next reply other threads:[~2021-10-21 5:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 5:57 Zheyu Ma [this message]
2021-10-21 8:37 ` [PATCH] ata: sata_mv: Fix the return value of the probe function Sergey Shtylyov
2021-10-21 10:38 ` Damien Le Moal
2021-10-21 11:23 ` Zheyu Ma
2021-10-22 1:40 ` Damien Le Moal
2021-10-22 1:41 ` Damien Le Moal
2021-10-22 9:18 ` Zheyu Ma
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=1634795836-1803-1-git-send-email-zheyuma97@gmail.com \
--to=zheyuma97@gmail.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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