gpio: pwm: Fix return type of pwm_gpio_set#7236
Merged
pelwell merged 1 commit intoraspberrypi:rpi-6.19.yfrom Feb 11, 2026
Merged
gpio: pwm: Fix return type of pwm_gpio_set#7236pelwell merged 1 commit intoraspberrypi:rpi-6.19.yfrom
pelwell merged 1 commit intoraspberrypi:rpi-6.19.yfrom
Conversation
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>
Contributor
Author
|
This is required for kernels >=6.17 due to d9d87d9. |
Collaborator
|
Ah: looks like we don't have this enabled, so don't see the error. |
Contributor
|
rpi-6.18.y would have been a more logical target branch, but I'll backport it. |
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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")