* [net] can: mcp251xfd: mcp251xfd_probe(): bail out if no IRQ was given
@ 2020-11-23 11:35 Marc Kleine-Budde
2020-11-26 14:52 ` AW: " petter
0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2020-11-23 11:35 UTC (permalink / raw)
To: linux-can
Cc: Manivannan Sadhasivam, Thomas Kopp, Marc Kleine-Budde, Niels Petter
This patch add a check to the mcp251xfd_probe() function to bail out and give
the user a proper error message if no IRQ is specified. Otherwise the driver
will probe just fine but ifup will fail with a meaningless "RTNETLINK answers:
Invalid argument" error message.
Reported-by: Niels Petter <petter@ka-long.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 9c215f7c5f81..8a39be076e14 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -2738,6 +2738,10 @@ static int mcp251xfd_probe(struct spi_device *spi)
u32 freq;
int err;
+ if (!spi->irq)
+ return dev_err_probe(&spi->dev, -ENXIO,
+ "No IRQ specified (maybe node \"interrupts-extended\" in DT missing)!\n");
+
rx_int = devm_gpiod_get_optional(&spi->dev, "microchip,rx-int",
GPIOD_IN);
if (PTR_ERR(rx_int) == -EPROBE_DEFER)
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* AW: [net] can: mcp251xfd: mcp251xfd_probe(): bail out if no IRQ was given
2020-11-23 11:35 [net] can: mcp251xfd: mcp251xfd_probe(): bail out if no IRQ was given Marc Kleine-Budde
@ 2020-11-26 14:52 ` petter
0 siblings, 0 replies; 2+ messages in thread
From: petter @ 2020-11-26 14:52 UTC (permalink / raw)
To: 'Marc Kleine-Budde', linux-can
Cc: 'Manivannan Sadhasivam', 'Thomas Kopp'
This patch add a check to the mcp251xfd_probe() function to bail out and
give the user a proper error message if no IRQ is specified. Otherwise the
driver will probe just fine but ifup will fail with a meaningless "RTNETLINK
answers:
Invalid argument" error message.
Reported-by: Niels Petter <petter@ka-long.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Niels Petter <petter@ka-long.de>
---
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 9c215f7c5f81..8a39be076e14 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -2738,6 +2738,10 @@ static int mcp251xfd_probe(struct spi_device *spi)
u32 freq;
int err;
+ if (!spi->irq)
+ return dev_err_probe(&spi->dev, -ENXIO,
+ "No IRQ specified (maybe node
\"interrupts-extended\" in DT
+missing)!\n");
+
rx_int = devm_gpiod_get_optional(&spi->dev, "microchip,rx-int",
GPIOD_IN);
if (PTR_ERR(rx_int) == -EPROBE_DEFER)
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-26 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 11:35 [net] can: mcp251xfd: mcp251xfd_probe(): bail out if no IRQ was given Marc Kleine-Budde
2020-11-26 14:52 ` AW: " petter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.