diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-05-01 13:14:15 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-05-07 08:44:38 -0400 |
commit | d4705316c18d371eb404d0ae5dcf51ce6e341d0f (patch) | |
tree | 3a582d8b2605e80a472d4c6607f1b478d7f2b786 /drivers/pinctrl | |
parent | 17723111e64fbcc327846ff0b33532bcf1d40f56 (diff) |
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: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | 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 2df753508eca..220fa492c9f0 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c | |||
@@ -92,7 +92,8 @@ static int pin_request(struct pinctrl_dev *pctldev, | |||
92 | desc = pin_desc_get(pctldev, pin); | 92 | desc = pin_desc_get(pctldev, pin); |
93 | if (desc == NULL) { | 93 | if (desc == NULL) { |
94 | dev_err(pctldev->dev, | 94 | dev_err(pctldev->dev, |
95 | "pin is not registered so it cannot be requested\n"); | 95 | "pin %d is not registered so it cannot be requested\n", |
96 | pin); | ||
96 | goto out; | 97 | goto out; |
97 | } | 98 | } |
98 | 99 | ||
@@ -103,7 +104,8 @@ static int pin_request(struct pinctrl_dev *pctldev, | |||
103 | /* There's no need to support multiple GPIO requests */ | 104 | /* There's no need to support multiple GPIO requests */ |
104 | if (desc->gpio_owner) { | 105 | if (desc->gpio_owner) { |
105 | dev_err(pctldev->dev, | 106 | dev_err(pctldev->dev, |
106 | "pin already requested\n"); | 107 | "pin %s already requested by %s; cannot claim for %s\n", |
108 | desc->name, desc->gpio_owner, owner); | ||
107 | goto out; | 109 | goto out; |
108 | } | 110 | } |
109 | 111 | ||
@@ -111,7 +113,8 @@ static int pin_request(struct pinctrl_dev *pctldev, | |||
111 | } else { | 113 | } else { |
112 | if (desc->mux_usecount && strcmp(desc->mux_owner, owner)) { | 114 | if (desc->mux_usecount && strcmp(desc->mux_owner, owner)) { |
113 | dev_err(pctldev->dev, | 115 | dev_err(pctldev->dev, |
114 | "pin already requested\n"); | 116 | "pin %s already requested by %s; cannot claim for %s\n", |
117 | desc->name, desc->mux_owner, owner); | ||
115 | goto out; | 118 | goto out; |
116 | } | 119 | } |
117 | 120 | ||
@@ -144,8 +147,7 @@ static int pin_request(struct pinctrl_dev *pctldev, | |||
144 | status = 0; | 147 | status = 0; |
145 | 148 | ||
146 | if (status) { | 149 | if (status) { |
147 | dev_err(pctldev->dev, "request on device %s failed for pin %d\n", | 150 | dev_err(pctldev->dev, "request() failed for pin %d\n", pin); |
148 | pctldev->desc->name, pin); | ||
149 | module_put(pctldev->owner); | 151 | module_put(pctldev->owner); |
150 | } | 152 | } |
151 | 153 | ||
@@ -162,7 +164,7 @@ out_free_pin: | |||
162 | out: | 164 | out: |
163 | if (status) | 165 | if (status) |
164 | dev_err(pctldev->dev, "pin-%d (%s) status %d\n", | 166 | dev_err(pctldev->dev, "pin-%d (%s) status %d\n", |
165 | pin, owner, status); | 167 | pin, owner, status); |
166 | 168 | ||
167 | return status; | 169 | return status; |
168 | } | 170 | } |