mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Deepak Das <deepak_das@mentor.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: vzapolsk <Vladimir_Zapolskiy@mentor.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH v2] driver: base: pinctrl: return error from, pinctrl_bind_pins()
Date: Wed, 14 Sep 2016 12:04:18 +0530	[thread overview]
Message-ID: <57D8EF6A.2050200@mentor.com> (raw)

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>
---
Changes from v1 to v2:
* Modified the comment to indicate return error in case of
   invalid pin requests

  drivers/base/pinctrl.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/pinctrl.c b/drivers/base/pinctrl.c
index 5fb74b4..12f0eb5 100644
--- a/drivers/base/pinctrl.c
+++ b/drivers/base/pinctrl.c
@@ -80,8 +80,8 @@ cleanup_alloc:
         devm_kfree(dev, dev->pins);
         dev->pins = NULL;

-       /* Only return deferrals */
-       if (ret != -EPROBE_DEFER)
+       /* Return deferrals & invalid pin requests */
+       if ((ret != -EPROBE_DEFER) && (ret != -EINVAL))
                 ret = 0;

         return ret;
--
1.9.1

             reply	other threads:[~2016-09-14  6:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  6:34 Deepak Das [this message]
2016-09-14 12:39 ` 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=57D8EF6A.2050200@mentor.com \
    --to=deepak_das@mentor.com \
    --cc=Vladimir_Zapolskiy@mentor.com \
    --cc=linus.walleij@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome