[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdaP+tkJn8jcR_RaCz_c6hk66F8qde2KRiCzNyyLWUkgjw@mail.gmail.com>
Date: Tue, 19 Nov 2013 10:24:22 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
David Cohen <david.a.cohen@...el.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
Alexandre Courbot <acourbot@...dia.com>
Cc: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@...el.com>,
Len Brown <lenb@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Grant Likely <grant.likely@...aro.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>
Subject: Re: [PATCH v1.2] gpiolib: append SFI helpers for GPIO API
On Wed, Jun 5, 2013 at 3:58 PM, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
> To support some (legacy) firmwares and platforms let's make life easier for
> their customers.
>
> This patch extracts SFI GPIO API from arch/x86/platform/mrst/mrst.c.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
So since this patch was ACKed the world has changed a bit and now
I want new changes (or maybe I was tired and not paying enough
attention at the time).
(...)
> +int sfi_get_gpio_by_name(const char *name)
> +{
> + struct sfi_gpio_table_entry *pentry = sfi_gpio_table;
> + int i;
> +
> + if (!pentry)
> + return -EINVAL;
> +
> + for (i = 0; i < sfi_gpio_num_entry; i++, pentry++) {
> + if (!strncmp(name, pentry->pin_name, SFI_NAME_LEN))
> + return pentry->pin_no;
> + }
> +
> + return -ENODEV;
> +}
> +EXPORT_SYMBOL_GPL(sfi_get_gpio_by_name);
Last merge window we merged the GPIO descriptor API and this
is now the recommended way to handle GPIOs and it is also
deployed into the ACPI and DT implementations.
So I'd like the signature of this function changed to return
a GPIO descriptor rather than an int so we don't stockpile more
stuff to refactor.
i.e.:
struct gpio_desc *sfi_get_gpio_by_name(const char *name);
--- /dev/null
> +++ b/include/linux/sfi_gpio.h
Maybe that header could move to <linux/gpio/sfi.h> instead.
Alexandre what do you think?
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists