Skip to content

Commit 0103d80

Browse files
MingcongBaiFearyncess
authored andcommitted
AOSCOS: gpio: aaeon: 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. Fixes: "UBUNTU: ODM: gpio: add driver for AAEON devices" Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
1 parent 3865681 commit 0103d80

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

drivers/gpio/gpio-aaeon.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static int aaeon_gpio_input_set_direction(struct gpio_chip *chip,
5050
unsigned int offset);
5151
static int aaeon_gpio_get(struct gpio_chip *chip,
5252
unsigned int offset);
53-
static void aaeon_gpio_set(struct gpio_chip *chip, unsigned int offset,
53+
static int aaeon_gpio_set(struct gpio_chip *chip, unsigned int offset,
5454
int value);
5555

5656
#define AAEON_GPIO_BANK(_base, _ngpio, _regbase) \
@@ -131,16 +131,21 @@ static int aaeon_gpio_get(struct gpio_chip *chip, unsigned int offset)
131131
return retval;
132132
}
133133

134-
static void aaeon_gpio_set(struct gpio_chip *chip, unsigned int offset,
135-
int value)
134+
static int aaeon_gpio_set(struct gpio_chip *chip, unsigned int offset,
135+
int value)
136136
{
137-
int retval;
137+
int err, retval;
138138
u32 dev_id = offset;
139139

140140
if (value)
141141
dev_id = BIT(16) | dev_id;
142142

143-
asus_wmi_evaluate_method(SET_LEVEL_METHOD_ID, dev_id, 0, &retval);
143+
retval = asus_wmi_evaluate_method(SET_LEVEL_METHOD_ID, dev_id, 0, &retval);
144+
145+
if (err)
146+
return err;
147+
148+
return retval;
144149
}
145150

146151
static int aaeon_gpio_get_number(void)

0 commit comments

Comments
 (0)