mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 18:25:48 -04:00
gpio: rcar: Use new line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return integers, so they can indicate failures. Convert the driver to using them. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/f09a0481fc0ddafb9aa05d903fbb42ef52332c03.1750838486.git.geert+renesas@glider.be Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
committed by
Bartosz Golaszewski
parent
28a9ab01f6
commit
3315e39e56
@@ -356,7 +356,7 @@ static int gpio_rcar_get_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gpio_rcar_set(struct gpio_chip *chip, unsigned offset, int value)
|
||||
static int gpio_rcar_set(struct gpio_chip *chip, unsigned int offset, int value)
|
||||
{
|
||||
struct gpio_rcar_priv *p = gpiochip_get_data(chip);
|
||||
unsigned long flags;
|
||||
@@ -364,10 +364,12 @@ static void gpio_rcar_set(struct gpio_chip *chip, unsigned offset, int value)
|
||||
raw_spin_lock_irqsave(&p->lock, flags);
|
||||
gpio_rcar_modify_bit(p, OUTDT, offset, value);
|
||||
raw_spin_unlock_irqrestore(&p->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||||
unsigned long *bits)
|
||||
static int gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||||
unsigned long *bits)
|
||||
{
|
||||
u32 bankmask = mask[0] & GENMASK(chip->ngpio - 1, 0);
|
||||
struct gpio_rcar_priv *p = gpiochip_get_data(chip);
|
||||
@@ -380,6 +382,8 @@ static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||||
val |= (bankmask & bits[0]);
|
||||
gpio_rcar_write(p, OUTDT, val);
|
||||
raw_spin_unlock_irqrestore(&p->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gpio_rcar_direction_output(struct gpio_chip *chip, unsigned offset,
|
||||
@@ -531,8 +535,8 @@ static int gpio_rcar_probe(struct platform_device *pdev)
|
||||
gpio_chip->get = gpio_rcar_get;
|
||||
gpio_chip->get_multiple = gpio_rcar_get_multiple;
|
||||
gpio_chip->direction_output = gpio_rcar_direction_output;
|
||||
gpio_chip->set = gpio_rcar_set;
|
||||
gpio_chip->set_multiple = gpio_rcar_set_multiple;
|
||||
gpio_chip->set_rv = gpio_rcar_set;
|
||||
gpio_chip->set_multiple_rv = gpio_rcar_set_multiple;
|
||||
gpio_chip->label = name;
|
||||
gpio_chip->parent = dev;
|
||||
gpio_chip->owner = THIS_MODULE;
|
||||
|
||||
Reference in New Issue
Block a user