mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pinctrl: Make "hog" mapping table entries work
@ 2012-02-14 17:50 Stephen Warren
  2012-02-15  4:38 ` Dong Aisheng
  2012-02-16 18:59 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Warren @ 2012-02-14 17:50 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, Stephen Warren

Commit 77a5988 "pinctrl: changes hog mechanism to be self-referential"
modified the way "hog" entries were represented in the mapping table.
However, the new representation failed some error checks in
pinctrl_hog_map(). Remove the now-bogus error-check, and fix the code
to solve the issue the error-check used to avoid.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 drivers/pinctrl/core.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index c5f76ad..8a91eb2 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -725,23 +725,11 @@ static int pinctrl_hog_map(struct pinctrl_dev *pctldev,
 	struct pinctrl *p;
 	int ret;
 
-	if (map->dev_name) {
-		/*
-		 * TODO: the day we have device tree support, we can
-		 * traverse the device tree and hog to specific device nodes
-		 * without any problems, so then we can hog pinmuxes for
-		 * all devices that just want a static pin mux at this point.
-		 */
-		dev_err(pctldev->dev, "map %s wants to hog a non-system pinmux, this is not going to work\n",
-				map->name);
-		return -EINVAL;
-	}
-
 	hog = kzalloc(sizeof(struct pinctrl_hog), GFP_KERNEL);
 	if (!hog)
 		return -ENOMEM;
 
-	p = pinctrl_get(NULL, map->name);
+	p = pinctrl_get(pctldev->dev, map->name);
 	if (IS_ERR(p)) {
 		kfree(hog);
 		dev_err(pctldev->dev,
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: Make "hog" mapping table entries work
  2012-02-14 17:50 [PATCH] pinctrl: Make "hog" mapping table entries work Stephen Warren
@ 2012-02-15  4:38 ` Dong Aisheng
  2012-02-16 18:59 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Dong Aisheng @ 2012-02-15  4:38 UTC (permalink / raw)
  To: Stephen Warren; +Cc: Linus Walleij, linux-kernel

On Tue, Feb 14, 2012 at 10:50:41AM -0700, Stephen Warren wrote:
> Commit 77a5988 "pinctrl: changes hog mechanism to be self-referential"
> modified the way "hog" entries were represented in the mapping table.
> However, the new representation failed some error checks in
> pinctrl_hog_map(). Remove the now-bogus error-check, and fix the code
> to solve the issue the error-check used to avoid.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Acked-by: Dong Aisheng <dong.aisheng@linaro.org>

Regards
Dong Aisheng

> ---
>  drivers/pinctrl/core.c |   14 +-------------
>  1 files changed, 1 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> index c5f76ad..8a91eb2 100644
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -725,23 +725,11 @@ static int pinctrl_hog_map(struct pinctrl_dev *pctldev,
>  	struct pinctrl *p;
>  	int ret;
>  
> -	if (map->dev_name) {
> -		/*
> -		 * TODO: the day we have device tree support, we can
> -		 * traverse the device tree and hog to specific device nodes
> -		 * without any problems, so then we can hog pinmuxes for
> -		 * all devices that just want a static pin mux at this point.
> -		 */
> -		dev_err(pctldev->dev, "map %s wants to hog a non-system pinmux, this is not going to work\n",
> -				map->name);
> -		return -EINVAL;
> -	}
> -
>  	hog = kzalloc(sizeof(struct pinctrl_hog), GFP_KERNEL);
>  	if (!hog)
>  		return -ENOMEM;
>  
> -	p = pinctrl_get(NULL, map->name);
> +	p = pinctrl_get(pctldev->dev, map->name);
>  	if (IS_ERR(p)) {
>  		kfree(hog);
>  		dev_err(pctldev->dev,
> -- 
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: Make "hog" mapping table entries work
  2012-02-14 17:50 [PATCH] pinctrl: Make "hog" mapping table entries work Stephen Warren
  2012-02-15  4:38 ` Dong Aisheng
@ 2012-02-16 18:59 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-02-16 18:59 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-kernel

On Tue, Feb 14, 2012 at 6:50 PM, Stephen Warren <swarren@nvidia.com> wrote:

> Commit 77a5988 "pinctrl: changes hog mechanism to be self-referential"
> modified the way "hog" entries were represented in the mapping table.
> However, the new representation failed some error checks in
> pinctrl_hog_map(). Remove the now-bogus error-check, and fix the code
> to solve the issue the error-check used to avoid.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Nice catch! Applied with Dong's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-16 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-14 17:50 [PATCH] pinctrl: Make "hog" mapping table entries work Stephen Warren
2012-02-15  4:38 ` Dong Aisheng
2012-02-16 18:59 ` Linus Walleij

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®