From: Conor Dooley <conor.dooley@microchip.com>
To: Mark Brown <broonie@kernel.org>
Cc: Daire McNamara <daire.mcnamara@microchip.com>,
Lewis Hanly <lewis.hanly@microchip.com>,
Conor Dooley <conor.dooley@microchip.com>,
<linux-riscv@lists.infradead.org>, <linux-spi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Yang Li <yang.lee@linux.alibaba.com>
Subject: [PATCH] spi: microchip-core: fix potentially incorrect return from probe
Date: Tue, 14 Jun 2022 07:58:10 +0100 [thread overview]
Message-ID: <20220614065809.1969177-1-conor.dooley@microchip.com> (raw)
If platform_get_irqi() returns 0, the error case will be triggered but
probe() will return 0 rather than an error. Ape the other drivers using
this pattern and return -ENXIO.
Reported-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/linux-spi/20220609055533.95866-2-yang.lee@linux.alibaba.com/
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
drivers/spi/spi-microchip-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index 5b22a1395554..856a68fd8e9f 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
spi->irq = platform_get_irq(pdev, 0);
if (spi->irq <= 0) {
dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
- ret = spi->irq;
+ ret = -ENXIO;
goto error_release_master;
}
--
2.36.1
next reply other threads:[~2022-06-14 7:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-14 6:58 Conor Dooley [this message]
2022-06-14 7:34 ` Conor.Dooley
2022-06-14 11:51 ` Mark Brown
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=20220614065809.1969177-1-conor.dooley@microchip.com \
--to=conor.dooley@microchip.com \
--cc=broonie@kernel.org \
--cc=daire.mcnamara@microchip.com \
--cc=lewis.hanly@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=yang.lee@linux.alibaba.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®