Skip to content

Commit 757259d

Browse files
Bartosz Golaszewskijmberg-intel
authored andcommitted
ssb: 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]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 9410e28 commit 757259d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/ssb/driver_gpio.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ static int ssb_gpio_chipco_get_value(struct gpio_chip *chip, unsigned int gpio)
4545
return !!ssb_chipco_gpio_in(&bus->chipco, 1 << gpio);
4646
}
4747

48-
static void ssb_gpio_chipco_set_value(struct gpio_chip *chip, unsigned int gpio,
49-
int value)
48+
static int ssb_gpio_chipco_set_value(struct gpio_chip *chip, unsigned int gpio,
49+
int value)
5050
{
5151
struct ssb_bus *bus = gpiochip_get_data(chip);
5252

5353
ssb_chipco_gpio_out(&bus->chipco, 1 << gpio, value ? 1 << gpio : 0);
54+
55+
return 0;
5456
}
5557

5658
static int ssb_gpio_chipco_direction_input(struct gpio_chip *chip,
@@ -223,7 +225,7 @@ static int ssb_gpio_chipco_init(struct ssb_bus *bus)
223225
chip->request = ssb_gpio_chipco_request;
224226
chip->free = ssb_gpio_chipco_free;
225227
chip->get = ssb_gpio_chipco_get_value;
226-
chip->set = ssb_gpio_chipco_set_value;
228+
chip->set_rv = ssb_gpio_chipco_set_value;
227229
chip->direction_input = ssb_gpio_chipco_direction_input;
228230
chip->direction_output = ssb_gpio_chipco_direction_output;
229231
#if IS_ENABLED(CONFIG_SSB_EMBEDDED)

0 commit comments

Comments
 (0)