diff mbox series

[3/3] pwm: Drop function pwmchip_add_with_polarity()

Message ID 20201205165146.3866846-3-uwe@kleine-koenig.org
State Superseded
Headers show
Series [1/3] pwm: bcm-kona: Use pwmchip_add() instead of pwmchip_add_with_polarity() | expand

Commit Message

Uwe Kleine-König Dec. 5, 2020, 4:51 p.m. UTC
pwmchip_add() only calls pwmchip_add_with_polarity() and nothing else. All
other users of pwmchip_add_with_polarity() are gone. So drop
pwmchip_add_with_polarity() and move the code instead to pwmchip_add().

The initial assignment to pwm->state.polarity is dropped. In every correct
usage of the PWM API this value is overwritten later anyhow.

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
 include/linux/pwm.h | 2 --
 1 file changed, 2 deletions(-)

Comments

Uwe Kleine-König Dec. 7, 2020, 1:38 p.m. UTC | #1
On Sat, Dec 05, 2020 at 05:51:46PM +0100, Uwe Kleine-König wrote:
> pwmchip_add() only calls pwmchip_add_with_polarity() and nothing else. All
> other users of pwmchip_add_with_polarity() are gone. So drop
> pwmchip_add_with_polarity() and move the code instead to pwmchip_add().
> 
> The initial assignment to pwm->state.polarity is dropped. In every correct
> usage of the PWM API this value is overwritten later anyhow.
> 
> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
> ---
>  include/linux/pwm.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/linux/pwm.h b/include/linux/pwm.h
> index e4d84d4db293..8f4eefd129aa 100644
> --- a/include/linux/pwm.h
> +++ b/include/linux/pwm.h
> @@ -392,8 +392,6 @@ int pwm_capture(struct pwm_device *pwm, struct pwm_capture *result,
>  int pwm_set_chip_data(struct pwm_device *pwm, void *data);
>  void *pwm_get_chip_data(struct pwm_device *pwm);
>  
> -int pwmchip_add_with_polarity(struct pwm_chip *chip,
> -			      enum pwm_polarity polarity);

I forgot the relevant change in drivers/pwm/core.c. I will resend.

Best regards
Uwe
diff mbox series

Patch

diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index e4d84d4db293..8f4eefd129aa 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -392,8 +392,6 @@  int pwm_capture(struct pwm_device *pwm, struct pwm_capture *result,
 int pwm_set_chip_data(struct pwm_device *pwm, void *data);
 void *pwm_get_chip_data(struct pwm_device *pwm);
 
-int pwmchip_add_with_polarity(struct pwm_chip *chip,
-			      enum pwm_polarity polarity);
 int pwmchip_add(struct pwm_chip *chip);
 int pwmchip_remove(struct pwm_chip *chip);
 struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,