All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Deepak <deepak_das@mentor.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	vzapolsk <Vladimir_Zapolskiy@mentor.com>
Subject: Re: [PATCH] driver: base: pinctrl: return error from pinctrl_bind_pins()
Date: Tue, 13 Sep 2016 13:59:51 +0200	[thread overview]
Message-ID: <CACRpkdandEmr5PTfhUt39wMezMpbE9wEHDTR=jMidzUZY2Cn7A@mail.gmail.com> (raw)
In-Reply-To: <57D7A700.8080402@mentor.com>

On Tue, Sep 13, 2016 at 9:13 AM, Deepak <deepak_das@mentor.com> wrote:

> strict pin controller returns -EINVAL in case of pin request which
> is already claimed by somebody else.
> Following is the sequence of calling pin_request() from
> pinctrl_bind_pins():-
> pinctrl_bind_pins()->pinctrl_select_state()->pinmux_enable_setting()->
> pin_request()
>
> But pinctrl_bind_pins() only returns -EPROBE_DEFER which makes device
> driver probe successful even if the pin request is rejected by the pin
> controller subsystem.
>
> This commit modifies pinctrl_bind_pins() to return error if the pin is
> rejected by pin control subsystem.
>
> Signed-off-by: Deepak Das <deepak_das@mentor.com>

Aha

>      /* Only return deferrals */
> -    if (ret != -EPROBE_DEFER)
> +    if ((ret != -EPROBE_DEFER) && (ret != -EINVAL))
>          ret = 0;

I rewrote this when applying, like this:

-       /* Only return deferrals */
-       if (ret != -EPROBE_DEFER)
-               ret = 0;
+       /* Return deferrals */
+       if (ret == -EPROBE_DEFER)
+               return ret;
+       if (ret == -EINVAL) {
+               dev_err(dev, "could not initialize pin control state\n");
+               return ret;
+       }
+       /* We ignore errors like -ENOENT meaning no pinctrl state */

-       return ret;
+       return 0;

Can you confim that this works for you too?

Yours,
Linus Walleij

  reply	other threads:[~2016-09-13 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13  7:13 [PATCH] driver: base: pinctrl: return error from pinctrl_bind_pins() Deepak
2016-09-13  7:13 ` Deepak
2016-09-13 11:59 ` Linus Walleij [this message]
2016-09-13 13:41   ` Deepak Das
2016-09-13 21:01     ` Linus Walleij
2016-09-14  6:22       ` Deepak Das

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='CACRpkdandEmr5PTfhUt39wMezMpbE9wEHDTR=jMidzUZY2Cn7A@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=Vladimir_Zapolskiy@mentor.com \
    --cc=deepak_das@mentor.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.