mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-05-26 11:40:24 +02:00
gpio: pch: 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: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-3-74abf689fbd8@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
@@ -99,7 +99,7 @@ struct pch_gpio {
|
||||
spinlock_t spinlock;
|
||||
};
|
||||
|
||||
static void pch_gpio_set(struct gpio_chip *gpio, unsigned int nr, int val)
|
||||
static int pch_gpio_set(struct gpio_chip *gpio, unsigned int nr, int val)
|
||||
{
|
||||
u32 reg_val;
|
||||
struct pch_gpio *chip = gpiochip_get_data(gpio);
|
||||
@@ -114,6 +114,8 @@ static void pch_gpio_set(struct gpio_chip *gpio, unsigned int nr, int val)
|
||||
|
||||
iowrite32(reg_val, &chip->reg->po);
|
||||
spin_unlock_irqrestore(&chip->spinlock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pch_gpio_get(struct gpio_chip *gpio, unsigned int nr)
|
||||
@@ -217,7 +219,7 @@ static void pch_gpio_setup(struct pch_gpio *chip)
|
||||
gpio->direction_input = pch_gpio_direction_input;
|
||||
gpio->get = pch_gpio_get;
|
||||
gpio->direction_output = pch_gpio_direction_output;
|
||||
gpio->set = pch_gpio_set;
|
||||
gpio->set_rv = pch_gpio_set;
|
||||
gpio->base = -1;
|
||||
gpio->ngpio = gpio_pins[chip->ioh];
|
||||
gpio->can_sleep = false;
|
||||
|
||||
Reference in New Issue
Block a user