gpiolib: have a single place of calling set_config()
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 24 Dec 2019 12:06:58 +0000 (13:06 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 7 Jan 2020 11:03:28 +0000 (12:03 +0100)
commitd90f36851d6595136b461773846b76e0c45e3e0c
tree6dee4ab64d6a5c014c71c00cddcb3df1d32cd9e5
parenta9001764c6fad9baf24172a4f585f7dcd6214c04
gpiolib: have a single place of calling set_config()

Instead of calling the gpiochip's set_config() callback directly and
checking its existence every time - just add a new routine that performs
this check internally. Call it in gpio_set_config() and
gpiod_set_transitory(). Also call it in gpiod_set_debounce() and drop
the check for chip->set() as it's irrelevant to this config option.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c