Skip to content

Commit 0466877

Browse files
Bartosz GolaszewskiWolfram Sang
authored andcommitted
i2c: mux: ltc4306: 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. Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Peter Rosin <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 1e5c9b1 commit 0466877

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/i2c/muxes/i2c-mux-ltc4306.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ static int ltc4306_gpio_get(struct gpio_chip *chip, unsigned int offset)
8585
return !!(val & BIT(1 - offset));
8686
}
8787

88-
static void ltc4306_gpio_set(struct gpio_chip *chip, unsigned int offset,
89-
int value)
88+
static int ltc4306_gpio_set(struct gpio_chip *chip, unsigned int offset,
89+
int value)
9090
{
9191
struct ltc4306 *data = gpiochip_get_data(chip);
9292

93-
regmap_update_bits(data->regmap, LTC_REG_CONFIG, BIT(5 - offset),
94-
value ? BIT(5 - offset) : 0);
93+
return regmap_update_bits(data->regmap, LTC_REG_CONFIG,
94+
BIT(5 - offset), value ? BIT(5 - offset) : 0);
9595
}
9696

9797
static int ltc4306_gpio_get_direction(struct gpio_chip *chip,
@@ -164,7 +164,7 @@ static int ltc4306_gpio_init(struct ltc4306 *data)
164164
data->gpiochip.direction_input = ltc4306_gpio_direction_input;
165165
data->gpiochip.direction_output = ltc4306_gpio_direction_output;
166166
data->gpiochip.get = ltc4306_gpio_get;
167-
data->gpiochip.set = ltc4306_gpio_set;
167+
data->gpiochip.set_rv = ltc4306_gpio_set;
168168
data->gpiochip.set_config = ltc4306_gpio_set_config;
169169
data->gpiochip.owner = THIS_MODULE;
170170

0 commit comments

Comments
 (0)