Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stephen Warren and committed by
Linus Walleij
d4705316 17723111

+8 -6
+8 -6
drivers/pinctrl/pinmux.c
··· 92 92 desc = pin_desc_get(pctldev, pin); 93 93 if (desc == NULL) { 94 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 97 goto out; 97 98 } 98 99 ··· 104 103 /* There's no need to support multiple GPIO requests */ 105 104 if (desc->gpio_owner) { 106 105 dev_err(pctldev->dev, 107 - "pin already requested\n"); 106 + "pin %s already requested by %s; cannot claim for %s\n", 107 + desc->name, desc->gpio_owner, owner); 108 108 goto out; 109 109 } 110 110 ··· 113 111 } else { 114 112 if (desc->mux_usecount && strcmp(desc->mux_owner, owner)) { 115 113 dev_err(pctldev->dev, 116 - "pin already requested\n"); 114 + "pin %s already requested by %s; cannot claim for %s\n", 115 + desc->name, desc->mux_owner, owner); 117 116 goto out; 118 117 } 119 118 ··· 147 144 status = 0; 148 145 149 146 if (status) { 150 - dev_err(pctldev->dev, "request on device %s failed for pin %d\n", 151 - pctldev->desc->name, pin); 147 + dev_err(pctldev->dev, "request() failed for pin %d\n", pin); 152 148 module_put(pctldev->owner); 153 149 } 154 150 ··· 164 162 out: 165 163 if (status) 166 164 dev_err(pctldev->dev, "pin-%d (%s) status %d\n", 167 - pin, owner, status); 165 + pin, owner, status); 168 166 169 167 return status; 170 168 }