Skip to content

Commit ec7cf0f

Browse files
juerghpelwell
authored andcommitted
gpio: pwm: Fix return type of pwm_gpio_set
Fixes the following build failure: drivers/gpio/gpio-pwm.c:108:26: error: assignment to 'int (*)(struct gpio_chip *, unsigned int, int)' from incompatible pointer type 'void (*)(struct gpio_chip *, unsigned int, int)' [-Wincompatible-pointer-types] 108 | pwm_gpio->gc.set = pwm_gpio_set; | ^ drivers/gpio/gpio-pwm.c:30:13: note: 'pwm_gpio_set' declared here 30 | static void pwm_gpio_set(struct gpio_chip *gc, unsigned int off, int val) | ^~~~~~~~~~~~ Fixes: 8b95d76 ("drivers/gpio: Add a driver that wraps the PWM API as a GPIO controller") Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
1 parent 0f10f52 commit ec7cf0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpio/gpio-pwm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ static int pwm_gpio_get_direction(struct gpio_chip *gc, unsigned int off)
2727
return GPIO_LINE_DIRECTION_OUT;
2828
}
2929

30-
static void pwm_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
30+
static int pwm_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
3131
{
3232
struct pwm_gpio *pwm_gpio = gpiochip_get_data(gc);
3333
struct pwm_state state;
3434

3535
pwm_get_state(pwm_gpio->pwm[off], &state);
3636
state.duty_cycle = val ? state.period : 0;
37-
pwm_apply_might_sleep(pwm_gpio->pwm[off], &state);
37+
return pwm_apply_might_sleep(pwm_gpio->pwm[off], &state);
3838
}
3939

4040
static int pwm_gpio_parse_dt(struct pwm_gpio *pwm_gpio,

0 commit comments

Comments
 (0)