Skip to contentSkip to conversation

pinctrl: Make "hog" mapping table entries work

PATCH In review Stephen Warren 3 participants 3 messages Feb 14, 2012 – Feb 16, 2012 Pin control

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: Make "hog" mapping table entries work

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.

---
 drivers/pinctrl/core.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
drivers/pinctrl/core.c +1 -13
index c5f76ad..8a91eb2 100644
@@ -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,
Signature · 1 line
1.7.0.4
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · 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.

Regards
Dong Aisheng

Quoted 41 lines
---
 drivers/pinctrl/core.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
drivers/pinctrl/core.c +1 -13
index c5f76ad..8a91eb2 100644
@@ -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,
Signature · 7 lines
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#2 lore raw
In reply to Stephen Warren
Quoted 7 lines · 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.

Nice catch! Applied with Dong's ACK.

Yours,
Linus Walleij