Re: [PATCH v12 3/7] gpiolib: of: make fwnode take precedence in struct gpio_chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 03, 2021 at 02:29:59PM +0100, Bartosz Golaszewski wrote:
> If the driver sets the fwnode in struct gpio_chip, let it take
> precedence over the of_node.

> Signed-off-by: Bartosz Golaszewski <brgl@xxxxxxxx>
> ---
>  drivers/gpio/gpiolib-of.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 0ad288ab6262..91dcf2c6cdd8 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -1046,6 +1046,9 @@ void of_gpio_dev_init(struct gpio_chip *gc, struct gpio_device *gdev)
>  	if (gc->parent)
>  		gdev->dev.of_node = gc->parent->of_node;
>  
> +	if (gc->fwnode)
> +		gc->of_node = to_of_node(gc->fwnode);
> +
>  	/* If the gpiochip has an assigned OF node this takes precedence */
>  	if (gc->of_node)
>  		gdev->dev.of_node = gc->of_node;

Similar should be done in acpi_gpio_dev_init():

	if (gc->fwnode)
		device_set_node(&gdev->dev, gc->fwnode);

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux