Skip to content

gpio: pwm: Fix return type of pwm_gpio_set - #7236

Merged
pelwell merged 1 commit into
raspberrypi:rpi-6.19.yfrom
juergh:fix-pwm_gpio_set-return-type
Feb 11, 2026
Merged

pelwell merged 1 commit into
raspberrypi:rpi-6.19.yfrom
juergh:fix-pwm_gpio_set-return-type

Conversation

@juergh

@juergh juergh commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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")

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>
@juergh

juergh commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

This is required for kernels >=6.17 due to d9d87d9.

@popcornmix

Copy link
Copy Markdown
Collaborator

Ah:

$ grep CONFIG_GPIO_PWM  .config
# CONFIG_GPIO_PWM is not set

looks like we don't have this enabled, so don't see the error.
But it looks fine to me.

@pelwell

pelwell commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

rpi-6.18.y would have been a more logical target branch, but I'll backport it.

@pelwell
pelwell merged commit 06cd438 into raspberrypi:rpi-6.19.y Feb 11, 2026
11 of 12 checks passed
@6by9

6by9 commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

TBH I'd be tempted to remove the driver totally.

I'd written it so that you could use some outputs of a NXP PCA9685 16 chan PWM controller as GPIOs , but the driver for that chip can now do that natively. (It looks like it's been able to do that for 10 years, so I'm not sure why I thought it was necessary in 2021).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants