tobetter / linux

Linux kernel source tree
Other
68 stars 30 forks source link

CONFIG_PWM_GPIO #32

Closed pyavitz closed 2 years ago

pyavitz commented 2 years ago

The following commit seems to be broken on 5.15.y.

drivers/pwm/pwm-gpio.c: In function ‘gpio_pwm_remove’:
drivers/pwm/pwm-gpio.c:232:9: error: void value not ignored as it ought to be
  232 |  return pwmchip_remove(&gpio_chip->chip);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pwm/pwm-gpio.c:233:1: error: control reaches end of non-void function [-Werror=return-type]

Unless its me? But it compiles fine on 5.14.15

pyavitz commented 2 years ago

In my testing the following seems to correct the problem and bring the fan back to life.

--- a/drivers/pwm/pwm-gpio.c    2021-10-30 06:18:02.000000000 -0400
+++ b/drivers/pwm/pwm-gpio.c    2021-11-01 13:09:47.822237106 -0400
@@ -229,7 +229,9 @@
        hrtimer_cancel(&gpio_data->timer);
    }

-   return pwmchip_remove(&gpio_chip->chip);
+   pwmchip_remove(&gpio_chip->chip);
+   
+   return 0;
 }

 static const struct of_device_id gpio_pwm_of_match[] = {
tobetter commented 2 years ago

Thanks, I didn't aware of this yet. The fix has been uploaded. :) https://github.com/tobetter/linux/commit/817779d3e11400515fdb46ec2bade03b6bd5139a

pyavitz commented 2 years ago

Thanks