提交 23a895ae 编写于 作者: T Thomas Petazzoni 提交者: Linus Walleij

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: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: NStephen Warren <swarren@wwwdotorg.org>
Acked-by: NColin Cross <ccross@google.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 9e605cb6
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册