public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ata: sata_mv: Fix the return value of the probe function
@ 2021-10-21  5:57 Zheyu Ma
  2021-10-21  8:37 ` Sergey Shtylyov
  0 siblings, 1 reply; 7+ messages in thread
From: Zheyu Ma @ 2021-10-21  5:57 UTC (permalink / raw)
  To: damien.lemoal; +Cc: linux-ide, linux-kernel, Zheyu Ma

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-22  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21  5:57 [PATCH] ata: sata_mv: Fix the return value of the probe function Zheyu Ma
2021-10-21  8:37 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox