Skip to content

Commit 1a1c436

Browse files
can: mcp251xfd: mcp251xfd_probe(): bail out if no IRQ was given
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. Link: https://lore.kernel.org/r/20201123113522.3820052-1-mkl@pengutronix.de Reported-by: Niels Petter <petter@ka-long.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent 4ba1cb3 commit 1a1c436

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,6 +2738,10 @@ static int mcp251xfd_probe(struct spi_device *spi)
27382738
u32 freq;
27392739
int err;
27402740

2741+
if (!spi->irq)
2742+
return dev_err_probe(&spi->dev, -ENXIO,
2743+
"No IRQ specified (maybe node \"interrupts-extended\" in DT missing)!\n");
2744+
27412745
rx_int = devm_gpiod_get_optional(&spi->dev, "microchip,rx-int",
27422746
GPIOD_IN);
27432747
if (PTR_ERR(rx_int) == -EPROBE_DEFER)

0 commit comments

Comments
 (0)