devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Magnus Damm <magnus.damm@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Linux-SH <linux-sh@vger.kernel.org>
Subject: Re: [PATCH/RFC] gpio: em: Use dynamic allocation of GPIOs
Date: Tue, 18 Nov 2014 12:11:18 +0900	[thread overview]
Message-ID: <CAAVeFuKGYM56KP8TOZAwSjDGWrVNoK1phpxoOdEJ=Ng9haSnmg@mail.gmail.com> (raw)
In-Reply-To: <1416234632-16166-1-git-send-email-geert+renesas@glider.be>

On Mon, Nov 17, 2014 at 11:30 PM, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> Use dynamic allocation of GPIOs instead of looking at the gpio%u alias
> in DT.
> ---
>   - Is this correct? Not having to care about the alias would simplify the
>     to-be-written DT binding documentation.
>   - Completely untested.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
>  drivers/gpio/gpio-em.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
> index 21d34d4d473dcefe..c3434146f605748b 100644
> --- a/drivers/gpio/gpio-em.c
> +++ b/drivers/gpio/gpio-em.c
> @@ -330,12 +330,7 @@ static int em_gio_probe(struct platform_device *pdev)
>                         goto err0;
>                 }
>
> -               ret = of_alias_get_id(pdev->dev.of_node, "gpio");
> -               if (ret < 0) {
> -                       dev_err(&pdev->dev, "Couldn't get OF id\n");
> -                       goto err0;
> -               }
> -               pdata->gpio_base = ret * 32; /* 32 GPIOs per instance */
> +               pdata->gpio_base = -1;

User-space might break because of GPIO renumbering. Why not setting
gpio_base to -1 when the property is not present (instead of
triggering an error), keeping support for the property so existing
boards remain safe, and marking the property as deprecated in the
bindings documentation?

  parent reply	other threads:[~2014-11-18  3:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 14:30 [PATCH/RFC] gpio: em: Use dynamic allocation of GPIOs Geert Uytterhoeven
2014-11-17 14:34 ` Arnd Bergmann
2014-11-17 14:42   ` Geert Uytterhoeven
2014-11-18  3:11 ` Alexandre Courbot [this message]
2014-11-27 14:17   ` Linus Walleij
2014-11-27 14:13 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAVeFuKGYM56KP8TOZAwSjDGWrVNoK1phpxoOdEJ=Ng9haSnmg@mail.gmail.com' \
    --to=gnurou@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).