Skip to content

Commit 96498b8

Browse files
author
Bartosz Golaszewski
committed
gpio: crystalcove: 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/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 2661dc2 commit 96498b8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpio/gpio-crystalcove.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,18 @@ static int crystalcove_gpio_get(struct gpio_chip *chip, unsigned int gpio)
168168
return val & 0x1;
169169
}
170170

171-
static void crystalcove_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
171+
static int crystalcove_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
172172
{
173173
struct crystalcove_gpio *cg = gpiochip_get_data(chip);
174174
int reg = to_reg(gpio, CTRL_OUT);
175175

176176
if (reg < 0)
177-
return;
177+
return 0;
178178

179179
if (value)
180-
regmap_update_bits(cg->regmap, reg, 1, 1);
181-
else
182-
regmap_update_bits(cg->regmap, reg, 1, 0);
180+
return regmap_update_bits(cg->regmap, reg, 1, 1);
181+
182+
return regmap_update_bits(cg->regmap, reg, 1, 0);
183183
}
184184

185185
static int crystalcove_irq_type(struct irq_data *data, unsigned int type)
@@ -349,7 +349,7 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
349349
cg->chip.direction_input = crystalcove_gpio_dir_in;
350350
cg->chip.direction_output = crystalcove_gpio_dir_out;
351351
cg->chip.get = crystalcove_gpio_get;
352-
cg->chip.set = crystalcove_gpio_set;
352+
cg->chip.set_rv = crystalcove_gpio_set;
353353
cg->chip.base = -1;
354354
cg->chip.ngpio = CRYSTALCOVE_VGPIO_NUM;
355355
cg->chip.can_sleep = true;

0 commit comments

Comments
 (0)