Skip to content

Commit

Permalink
pinctrl: use kasprintf() in pinmux_request_gpio()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Petazzoni authored and Linus Walleij committed Sep 14, 2012
1 parent 9e605cb commit 23a895a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/pinctrl/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,11 @@ int pinmux_request_gpio(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned pin, unsigned gpio)
{
char gpiostr[16];
const char *owner;
int ret;

/* Conjure some name stating what chip and pin this is taken by */
snprintf(gpiostr, 15, "%s:%d", range->name, gpio);

owner = kstrdup(gpiostr, GFP_KERNEL);
owner = kasprintf(GFP_KERNEL, "%s:%d", range->name, gpio);
if (!owner)
return -EINVAL;

Expand Down

0 comments on commit 23a895a

Please sign in to comment.