summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-09-27 16:29:29 +0200
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-10-04 13:36:23 +0200
commit3c9d5431b40701e35e8af470d6a3e9babe44ffef (patch)
treee1fed31ee1472fd040437e4316dbd3a422150a99
parent0f21c53c28639c5c69ad01cebfc4be7b2805703a (diff)
gpio: acpi: replace gpiochip_find() with gpio_device_find()
We're porting all users of gpiochip_find() to using gpio_device_find(). Update the ACPI GPIO code. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
-rw-r--r--drivers/gpio/gpiolib-acpi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 17a86bdd9609..2ad21f34ee62 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -143,7 +143,6 @@ 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;
acpi_handle handle;
acpi_status status;
@@ -151,11 +150,16 @@ 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)
+ struct gpio_device *gdev __free(gpio_device_put) =
+ gpio_device_find(handle, acpi_gpiochip_find);
+ if (!gdev)
return ERR_PTR(-EPROBE_DEFER);
- return gpiochip_get_desc(chip, pin);
+ /*
+ * FIXME: keep track of the reference to the GPIO device somehow
+ * instead of putting it here.
+ */
+ return gpio_device_get_desc(gdev, pin);
}
/**