From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [RFC PATCH v2 12/16] input: gpio_keys_polled - Add support for GPIO descriptors Date: Wed, 24 Sep 2014 10:02:41 +0200 Message-ID: References: <1410868367-11056-1-git-send-email-mika.westerberg@linux.intel.com> <1410868367-11056-13-git-send-email-mika.westerberg@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <1410868367-11056-13-git-send-email-mika.westerberg@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Mika Westerberg Cc: "Rafael J. Wysocki" , ACPI Devel Maling List , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Alexandre Courbot , Dmitry Torokhov , Bryan Wu , Lee Jones , Grant Likely , Arnd Bergmann , Aaron Lu , Darren Hart List-Id: devicetree@vger.kernel.org On Tue, Sep 16, 2014 at 1:52 PM, Mika Westerberg wrote: > From: Aaron Lu > > 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 > Signed-off-by: Mika Westerberg Great! > #include > +#include Again 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 Yours, Linus Walleij