Commit d4705316 authored by Stephen Warren's avatar Stephen Warren Committed by Linus Walleij

pinctrl: add more info to error msgs in pin_request

Additionally print which pin the request failed for, which entity already
claimed it, and what entity was trying to claim it.

Remove duplicate device name from a debug message.

Clean up some indentation.
Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 17723111
...@@ -92,7 +92,8 @@ static int pin_request(struct pinctrl_dev *pctldev, ...@@ -92,7 +92,8 @@ static int pin_request(struct pinctrl_dev *pctldev,
desc = pin_desc_get(pctldev, pin); desc = pin_desc_get(pctldev, pin);
if (desc == NULL) { if (desc == NULL) {
dev_err(pctldev->dev, dev_err(pctldev->dev,
"pin is not registered so it cannot be requested\n"); "pin %d is not registered so it cannot be requested\n",
pin);
goto out; goto out;
} }
...@@ -103,7 +104,8 @@ static int pin_request(struct pinctrl_dev *pctldev, ...@@ -103,7 +104,8 @@ static int pin_request(struct pinctrl_dev *pctldev,
/* There's no need to support multiple GPIO requests */ /* There's no need to support multiple GPIO requests */
if (desc->gpio_owner) { if (desc->gpio_owner) {
dev_err(pctldev->dev, dev_err(pctldev->dev,
"pin already requested\n"); "pin %s already requested by %s; cannot claim for %s\n",
desc->name, desc->gpio_owner, owner);
goto out; goto out;
} }
...@@ -111,7 +113,8 @@ static int pin_request(struct pinctrl_dev *pctldev, ...@@ -111,7 +113,8 @@ static int pin_request(struct pinctrl_dev *pctldev,
} else { } else {
if (desc->mux_usecount && strcmp(desc->mux_owner, owner)) { if (desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
dev_err(pctldev->dev, dev_err(pctldev->dev,
"pin already requested\n"); "pin %s already requested by %s; cannot claim for %s\n",
desc->name, desc->mux_owner, owner);
goto out; goto out;
} }
...@@ -144,8 +147,7 @@ static int pin_request(struct pinctrl_dev *pctldev, ...@@ -144,8 +147,7 @@ static int pin_request(struct pinctrl_dev *pctldev,
status = 0; status = 0;
if (status) { if (status) {
dev_err(pctldev->dev, "request on device %s failed for pin %d\n", dev_err(pctldev->dev, "request() failed for pin %d\n", pin);
pctldev->desc->name, pin);
module_put(pctldev->owner); module_put(pctldev->owner);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment