Skip to content

Commit 53f2a24

Browse files
author
Bartosz Golaszewski
committed
gpio: amd8111: 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-9-1d5cceeebf8b@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent adf5412 commit 53f2a24

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/gpio/gpio-amd8111.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static void amd_gpio_free(struct gpio_chip *chip, unsigned offset)
9494
iowrite8(agp->orig[offset], agp->pm + AMD_REG_GPIO(offset));
9595
}
9696

97-
static void amd_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
97+
static int amd_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
9898
{
9999
struct amd_gpio *agp = gpiochip_get_data(chip);
100100
u8 temp;
@@ -107,6 +107,8 @@ static void amd_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
107107
spin_unlock_irqrestore(&agp->lock, flags);
108108

109109
dev_dbg(&agp->pdev->dev, "Setting gpio %d, value %d, reg=%02x\n", offset, !!value, temp);
110+
111+
return 0;
110112
}
111113

112114
static int amd_gpio_get(struct gpio_chip *chip, unsigned offset)
@@ -163,7 +165,7 @@ static struct amd_gpio gp = {
163165
.ngpio = 32,
164166
.request = amd_gpio_request,
165167
.free = amd_gpio_free,
166-
.set = amd_gpio_set,
168+
.set_rv = amd_gpio_set,
167169
.get = amd_gpio_get,
168170
.direction_output = amd_gpio_dirout,
169171
.direction_input = amd_gpio_dirin,

0 commit comments

Comments
 (0)