On Tue, Sep 16, 2014 at 1:52 PM, Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx> wrote: > From: Aaron Lu <aaron.lu@xxxxxxxxx> > > GPIO descriptors are the preferred way over legacy GPIO numbers > nowadays. Convert the driver to use GPIO descriptors internally but > still allow passing legacy GPIO numbers from platform data to support > existing platforms. > > Signed-off-by: Aaron Lu <aaron.lu@xxxxxxxxx> > Signed-off-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx> Great! > #include <linux/gpio.h> > +#include <linux/gpio/consumer.h> Again <linux/gpio.h> should not be needed anymore. > + /* > + * Legacy GPIO number so request the GPIO here and > + * convert it to descriptor. > + */ > + if (!button->gpiod && gpio_is_valid(button->gpio)) { > + unsigned flags = 0; > + > + if (button->active_low) > + flags |= GPIOF_ACTIVE_LOW; > + > + error = devm_gpio_request_one(&pdev->dev, button->gpio, > + flags, button->desc ? : DRV_NAME); > + if (error) { > + dev_err(dev, "unable to claim gpio %u, err=%d\n", > + button->gpio, error); > + return error; > + } > + > + button->gpiod = gpio_to_desc(button->gpio); So the field button->gpio is still there, this is a bit disturbing, but when I grep for it I see there is a multitude of users :-/ OK I guess these users have to be fixed one by one. Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html