[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZPiSKTfIU3BSrqTj@smile.fi.intel.com>
Date: Wed, 6 Sep 2023 17:52:25 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Aaro Koskinen <aaro.koskinen@....fi>,
Janusz Krzysztofik <jmkrzyszt@...il.com>,
Tony Lindgren <tony@...mide.com>,
Russell King <linux@...linux.org.uk>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Linus Walleij <linus.walleij@...aro.org>,
Dipen Patel <dipenp@...dia.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Hans de Goede <hdegoede@...hat.com>,
Mark Gross <markgross@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-omap@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-acpi@...r.kernel.org, timestamp@...ts.linux.dev,
linux-tegra@...r.kernel.org, platform-driver-x86@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 19/21] gpio: swnode: replace gpiochip_find() with
gpio_device_find_by_label()
On Tue, Sep 05, 2023 at 08:53:07PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> We're porting all users of gpiochip_find() to using gpio_device_find().
> Update the swnode GPIO code.
...
> -static int swnode_gpiochip_match_name(struct gpio_chip *chip, void *data)
> +static struct gpio_device *swnode_get_gpio_device(struct fwnode_handle *fwnode)
> {
> - return !strcmp(chip->label, data);
> -}
> + const struct software_node *gdev_node;
> + struct gpio_device *gdev;
>
> -static struct gpio_chip *swnode_get_chip(struct fwnode_handle *fwnode)
> -{
Not sure if you used --patience. Patches might look better.
> - const struct software_node *chip_node;
> - struct gpio_chip *chip;
> -
> - chip_node = to_software_node(fwnode);
> - if (!chip_node || !chip_node->name)
> + gdev_node = to_software_node(fwnode);
> + if (!gdev_node || !gdev_node->name)
> return ERR_PTR(-EINVAL);
>
> - chip = gpiochip_find((void *)chip_node->name, swnode_gpiochip_match_name);
> - return chip ?: ERR_PTR(-EPROBE_DEFER);
> + gdev = gpio_device_find_by_label((void *)gdev_node->name);
> + return gdev ?: ERR_PTR(-EPROBE_DEFER);
> }
...
> - desc = gpiochip_get_desc(chip, args.args[0]);
> + desc = gpiochip_get_desc(gdev->chip, args.args[0]);
gpio_device_get_desc() ?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists