mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-01 00:54:15 +08:00
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>
This commit is contained in:
parent
4ba1cb39fc
commit
1a1c436bad
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user