mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sonic Zhang <sonic.adi@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Grant Likely <grant.likely@linaro.org>,
	Steven Miao <realmz6@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	<buildroot-devel@blackfin.uclinux.org>,
	<adi-buildroot-devel@lists.sourceforge.net>,
	Sonic Zhang <sonic.zhang@analog.com>
Subject: [PATCH] pinctrl: pinmux: Don't free pins requested by other devices
Date: Wed, 17 Jul 2013 13:31:45 +0800	[thread overview]
Message-ID: <1374039105-17777-1-git-send-email-sonic.adi@gmail.com> (raw)

From: Sonic Zhang <sonic.zhang@analog.com>

in pinmux_disable_setting after current device fails to request
the same pins.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 drivers/pinctrl/pinmux.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 88cc509..9ebcf3b 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -482,13 +482,14 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting)
 				 pins[i]);
 			continue;
 		}
+		/* And release the pins */
+		if (desc->mux_usecount &&
+			!strcmp(desc->mux_owner, setting->dev_name))
+			pin_free(pctldev, pins[i], NULL);
+
 		desc->mux_setting = NULL;
 	}
 
-	/* And release the pins */
-	for (i = 0; i < num_pins; i++)
-		pin_free(pctldev, pins[i], NULL);
-
 	if (ops->disable)
 		ops->disable(pctldev, setting->data.mux.func, setting->data.mux.group);
 }
-- 
1.8.2.3



             reply	other threads:[~2013-07-17  5:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17  5:31 Sonic Zhang [this message]
2013-08-07 16:23 ` Linus Walleij
2013-08-07 17:09   ` Stephen Warren
2013-08-08  3:38     ` Sonic Zhang
2013-08-08  3:42   ` Sonic Zhang
2013-07-23  7:34 Sonic Zhang

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=1374039105-17777-1-git-send-email-sonic.adi@gmail.com \
    --to=sonic.adi@gmail.com \
    --cc=adi-buildroot-devel@lists.sourceforge.net \
    --cc=buildroot-devel@blackfin.uclinux.org \
    --cc=grant.likely@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=realmz6@gmail.com \
    --cc=sonic.zhang@analog.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

all inboxes | Powered by JetHome®