Commit 3c9d5431 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

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: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 0f21c53c
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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);
}

/**