can: mcp251xfd: mcp251xfd_probe(): bail out if no IRQ was given
Subsystems (2)
Marc Kleine-Budde
maintainerThis 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 <[email protected]>
Signed-off-by Marc Kleine-Budde <[email protected]>
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +4 -0
@@ -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 )
Signature · 1 line
2.29.2
[email protected]
Acked-byThis 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 <[email protected]>
Signed-off-by Marc Kleine-Budde <[email protected]>
Acked-by Niels Petter <[email protected]>
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 ++++ 1 file changed, 4 insertions(+)
(quoted diff) +0 -0
b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 9c215f7c5f81..8a39be076e14 100644
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +5 -0
@@ -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 +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