gpio: nomadik: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250610-gpiochip-set-rv-gpio-v1-8-3a9a3c1472ff@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
@@ -347,8 +347,8 @@ static int nmk_gpio_get_input(struct gpio_chip *chip, unsigned int offset)
|
||||
return value;
|
||||
}
|
||||
|
||||
static void nmk_gpio_set_output(struct gpio_chip *chip, unsigned int offset,
|
||||
int val)
|
||||
static int nmk_gpio_set_output(struct gpio_chip *chip, unsigned int offset,
|
||||
int val)
|
||||
{
|
||||
struct nmk_gpio_chip *nmk_chip = gpiochip_get_data(chip);
|
||||
|
||||
@@ -357,6 +357,8 @@ static void nmk_gpio_set_output(struct gpio_chip *chip, unsigned int offset,
|
||||
__nmk_gpio_set_output(nmk_chip, offset, val);
|
||||
|
||||
clk_disable(nmk_chip->clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned int offset,
|
||||
@@ -672,7 +674,7 @@ static int nmk_gpio_probe(struct platform_device *pdev)
|
||||
chip->direction_input = nmk_gpio_make_input;
|
||||
chip->get = nmk_gpio_get_input;
|
||||
chip->direction_output = nmk_gpio_make_output;
|
||||
chip->set = nmk_gpio_set_output;
|
||||
chip->set_rv = nmk_gpio_set_output;
|
||||
chip->dbg_show = nmk_gpio_dbg_show;
|
||||
chip->can_sleep = false;
|
||||
chip->owner = THIS_MODULE;
|
||||
|
||||
Reference in New Issue
Block a user