diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c index e4e16ba551be..b9327a33ec1d 100644 --- a/drivers/gpio/gpio-rockchip.c +++ b/drivers/gpio/gpio-rockchip.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -16,8 +17,8 @@ #include #include #include -#include #include +#include #include #include @@ -274,10 +275,10 @@ static int rockchip_gpio_set_config(struct gpio_chip *gc, unsigned int offset, { enum pin_config_param param = pinconf_to_config_param(config); unsigned int debounce = pinconf_to_config_argument(config); - int ret = 0; switch (param) { case PIN_CONFIG_INPUT_DEBOUNCE: + rockchip_gpio_set_debounce(gc, offset, debounce); /* * Rockchip's gpio could only support up to one period * of the debounce clock(pclk), which is far away from @@ -289,15 +290,10 @@ static int rockchip_gpio_set_config(struct gpio_chip *gc, unsigned int offset, * still return -ENOTSUPP as before, to make sure the caller * of gpiod_set_debounce won't change its behaviour. */ - rockchip_gpio_set_debounce(gc, offset, debounce); - ret = -ENOTSUPP; - break; + return -ENOTSUPP; default: - ret = -ENOTSUPP; - break; + return -ENOTSUPP; } - - return ret; } /*