Message ID | 20230912100727.23197-10-brgl@bgdev.pl (mailing list archive) |
---|---|
State | Handled Elsewhere, archived |
Headers | show |
Series | gpiolib: work towards removing gpiochip_find() | expand |
On Tue, Sep 12, 2023 at 12:07:25PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > We're porting all users of gpiochip_find() to using gpio_device_find(). > Update the ACPI GPIO code. ... > + /* > + * FIXME: keep track of this reference somehow instead of putting it > + * here. Under "this" you meant gdev? Please, spell it explicitly, I spent a couple of minutes to get what exactly this comment is about. > + */ > + return gpio_device_get_desc(gdev, pin); > }
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 17a86bdd9609..ec618962a5cb 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -143,7 +143,7 @@ static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) */ static struct gpio_desc *acpi_get_gpiod(char *path, unsigned int pin) { - struct gpio_chip *chip; + struct gpio_device *gdev __free(gpio_device_put) = NULL; acpi_handle handle; acpi_status status; @@ -151,11 +151,15 @@ static struct gpio_desc *acpi_get_gpiod(char *path, unsigned int pin) if (ACPI_FAILURE(status)) return ERR_PTR(-ENODEV); - chip = gpiochip_find(handle, acpi_gpiochip_find); - if (!chip) + gdev = gpio_device_find(handle, acpi_gpiochip_find); + if (!gdev) return ERR_PTR(-EPROBE_DEFER); - return gpiochip_get_desc(chip, pin); + /* + * FIXME: keep track of this reference somehow instead of putting it + * here. + */ + return gpio_device_get_desc(gdev, pin); } /**