]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: use kstrdup_const() for gpio_device label
authorBartosz Golaszewski <brgl@bgdev.pl>
Thu, 14 Dec 2017 14:29:20 +0000 (15:29 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 20 Dec 2017 08:16:39 +0000 (09:16 +0100)
commit45fca399da770d0ad4c3731143edc88f36c442f8
treebf5d05ee0bbd17904fc7efa59cfe45068e914df6
parent657e38a6b9e94c9a3d8ee424427cf6d79a7badac
gpiolib: use kstrdup_const() for gpio_device label

Users often pass a pointer to a static string to gpiochip_add_data()
family of functions. Avoid unnecessary memory allocations with the
provided helper routine.

While at it: use a ternary operator instead of an if else for brevity.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c