diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2012-09-13 15:48:14 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-09-14 09:53:13 -0400 |
commit | 23a895aee6081c144ffcc61eaf52dc62e10b3bd1 (patch) | |
tree | 42310daf0adc223c388100bd89ffba084db220f7 /drivers/pinctrl | |
parent | 9e605cb68a21d5704839a192a46ebcf387773704 (diff) |
pinctrl: use kasprintf() in pinmux_request_gpio()
Instead of using a temporary buffer, snprintf() and kstrdup(), just
use kasprintf() that does the same thing in just oneline.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Colin Cross <ccross@google.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinmux.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 3d5ac73bd5a7..9301a7a95eff 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c | |||
@@ -232,14 +232,11 @@ int pinmux_request_gpio(struct pinctrl_dev *pctldev, | |||
232 | struct pinctrl_gpio_range *range, | 232 | struct pinctrl_gpio_range *range, |
233 | unsigned pin, unsigned gpio) | 233 | unsigned pin, unsigned gpio) |
234 | { | 234 | { |
235 | char gpiostr[16]; | ||
236 | const char *owner; | 235 | const char *owner; |
237 | int ret; | 236 | int ret; |
238 | 237 | ||
239 | /* Conjure some name stating what chip and pin this is taken by */ | 238 | /* Conjure some name stating what chip and pin this is taken by */ |
240 | snprintf(gpiostr, 15, "%s:%d", range->name, gpio); | 239 | owner = kasprintf(GFP_KERNEL, "%s:%d", range->name, gpio); |
241 | |||
242 | owner = kstrdup(gpiostr, GFP_KERNEL); | ||
243 | if (!owner) | 240 | if (!owner) |
244 | return -EINVAL; | 241 | return -EINVAL; |
245 | 242 | ||