Re: [PATCH v6 5/6] can: mcp251xfd: add gpio functionality
From: Marc Kleine-Budde
Date: Wed Oct 01 2025 - 10:00:14 EST
On 01.10.2025 15:52:56, Bartosz Golaszewski wrote:
> On Wed, Oct 1, 2025 at 11:10 AM Viken Dadhaniya
> <viken.dadhaniya@xxxxxxxxxxxxxxxx> wrote:
> > +
> > + if (!device_property_present(&priv->spi->dev, "gpio-controller"))
> > + return 0;
> > +
>
> Hi! I didn't notice this before you're returning 0 here, meaning the
> device will be attached to the driver even though it doesn't do
> anything. It would make more sense to return -ENODEV.
I consider the GPIO functionality of the mcp251xfd CAN controllers
optional. So if the DT doesn't contain gpio-controller, continue without
GPIO functionality.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature