mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
gpio: xgene: 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. Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-9-b8950f69618d@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
47b427311d
commit
0933fc87f3
1 changed files with 4 additions and 2 deletions
|
@ -62,7 +62,7 @@ static void __xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
|
|||
iowrite32(setval, chip->base + bank_offset);
|
||||
}
|
||||
|
||||
static void xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
|
||||
static int xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
|
||||
{
|
||||
struct xgene_gpio *chip = gpiochip_get_data(gc);
|
||||
unsigned long flags;
|
||||
|
@ -70,6 +70,8 @@ static void xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
|
|||
spin_lock_irqsave(&chip->lock, flags);
|
||||
__xgene_gpio_set(gc, offset, val);
|
||||
spin_unlock_irqrestore(&chip->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xgene_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
|
||||
|
@ -176,7 +178,7 @@ static int xgene_gpio_probe(struct platform_device *pdev)
|
|||
gpio->chip.direction_input = xgene_gpio_dir_in;
|
||||
gpio->chip.direction_output = xgene_gpio_dir_out;
|
||||
gpio->chip.get = xgene_gpio_get;
|
||||
gpio->chip.set = xgene_gpio_set;
|
||||
gpio->chip.set_rv = xgene_gpio_set;
|
||||
gpio->chip.label = dev_name(&pdev->dev);
|
||||
gpio->chip.base = -1;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue