Skip to content

Commit 33dbb11

Browse files
author
Bartosz Golaszewski
committed
gpio: amd-fch: use new 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/20250303-gpiochip-set-conversion-v1-10-1d5cceeebf8b@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 53f2a24 commit 33dbb11

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/gpio/gpio-amd-fch.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ static int amd_fch_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
9595
return ret ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
9696
}
9797

98-
static void amd_fch_gpio_set(struct gpio_chip *gc,
99-
unsigned int gpio, int value)
98+
static int amd_fch_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
10099
{
101100
unsigned long flags;
102101
struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc);
@@ -113,6 +112,8 @@ static void amd_fch_gpio_set(struct gpio_chip *gc,
113112
writel_relaxed(mask, ptr);
114113

115114
spin_unlock_irqrestore(&priv->lock, flags);
115+
116+
return 0;
116117
}
117118

118119
static int amd_fch_gpio_get(struct gpio_chip *gc,
@@ -164,7 +165,7 @@ static int amd_fch_gpio_probe(struct platform_device *pdev)
164165
priv->gc.direction_output = amd_fch_gpio_direction_output;
165166
priv->gc.get_direction = amd_fch_gpio_get_direction;
166167
priv->gc.get = amd_fch_gpio_get;
167-
priv->gc.set = amd_fch_gpio_set;
168+
priv->gc.set_rv = amd_fch_gpio_set;
168169

169170
spin_lock_init(&priv->lock);
170171

0 commit comments

Comments
 (0)