Skip to content

Commit 3c9d543

Browse files
author
Bartosz Golaszewski
committed
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 <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Mika Westerberg <[email protected]>
1 parent 0f21c53 commit 3c9d543

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/gpio/gpiolib-acpi.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,23 @@ static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
143143
*/
144144
static struct gpio_desc *acpi_get_gpiod(char *path, unsigned int pin)
145145
{
146-
struct gpio_chip *chip;
147146
acpi_handle handle;
148147
acpi_status status;
149148

150149
status = acpi_get_handle(NULL, path, &handle);
151150
if (ACPI_FAILURE(status))
152151
return ERR_PTR(-ENODEV);
153152

154-
chip = gpiochip_find(handle, acpi_gpiochip_find);
155-
if (!chip)
153+
struct gpio_device *gdev __free(gpio_device_put) =
154+
gpio_device_find(handle, acpi_gpiochip_find);
155+
if (!gdev)
156156
return ERR_PTR(-EPROBE_DEFER);
157157

158-
return gpiochip_get_desc(chip, pin);
158+
/*
159+
* FIXME: keep track of the reference to the GPIO device somehow
160+
* instead of putting it here.
161+
*/
162+
return gpio_device_get_desc(gdev, pin);
159163
}
160164

161165
/**

0 commit comments

Comments
 (0)