mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Acked-by: Stephen Warren <[email protected]> Acked-by: Colin Cross <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
9e605cb68a
commit
23a895aee6
1 changed files with 1 additions and 4 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue