[PATCH] pinctrl: add more info to error msgs in pin_request

May 01st, 2012 - 01:20 pm ET by Stephen Warren | Report spam
From: Stephen Warren <swarren@nvidia.com>

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: Stephen Warren <swarren@nvidia.com>

drivers/pinctrl/pinmux.c | 14 ++++++++
1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 2df7535..220fa49 100644
a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -92,7 +92,8 @@ static int pin_request(struct pinctrl_dev *pctldev,
desc = pin_desc_get(pctldev, pin);
if (desc == NULL) {
dev_err(pctldev->dev,
- "pin is not registered so it cannot be requested");
+ "pin %d is not registered so it cannot be requested",
+ pin);
goto out;
}

@@ -103,7 +104,8 @@ static int pin_request(struct pinctrl_dev *pctldev,
/* There's no need to support multiple GPIO requests */
if (desc->gpio_owner) {
dev_err(pctldev->dev,
- "pin already requested");
+ "pin %s already requested by %s; cannot claim for %s",
+ desc->name, desc->gpio_owner, owner);
goto out;
}

@@ -111,7 +113,8 @@ static int pin_request(struct pinctrl_dev *pctldev,
} else {
if (desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
dev_err(pctldev->dev,
- "pin already requested");
+ "pin %s already requested by %s; cannot claim for %s",
+ desc->name, desc->mux_owner, owner);
goto out;
}

@@ -144,8 +147,7 @@ static int pin_request(struct pinctrl_dev *pctldev,
status = 0;

if (status) {
- dev_err(pctldev->dev, "request on device %s failed for pin %d",
- pctldev->desc->name, pin);
+ dev_err(pctldev->dev, "request() failed for pin %d", pin);
module_put(pctldev->owner);
}

@@ -162,7 +164,7 @@ out_free_pin:
out:
if (status)
dev_err(pctldev->dev, "pin-%d (%s) status %d",
- pin, owner, status);
+ pin, owner, status);

return status;
}
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/
email Follow the discussionReplies 1 replyReplies Make a reply

Replies

#1 Linus Walleij
May 07th, 2012 - 08:50 am ET | Report spam
On Tue, May 1, 2012 at 7:14 PM, Stephen Warren wrote:

From: Stephen Warren

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: Stephen Warren



Obviously fine, so applied.

Thanks,
Linus Walleij
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Similar topics