diff mbox series

[2/5] pwm: stm32: Make ch parameter unsigned

Message ID 20231019200658.1754190-9-u.kleine-koenig@pengutronix.de
State Accepted
Delegated to: Uwe Kleine-König
Headers show
Series pwm: stm32: Cleanups, get_state() and proper hw take over | expand

Commit Message

Uwe Kleine-König Oct. 19, 2023, 8:07 p.m. UTC
From: Philipp Zabel <p.zabel@pengutronix.de>

The channel parameter is only ever set to pwm->hwpwm.
Make it unsigned int as well.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/pwm-stm32.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Fabrice Gasnier Nov. 14, 2023, 1:26 p.m. UTC | #1
On 10/19/23 22:07, Uwe Kleine-König wrote:
> From: Philipp Zabel <p.zabel@pengutronix.de>
> 
> The channel parameter is only ever set to pwm->hwpwm.
> Make it unsigned int as well.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/pwm/pwm-stm32.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Hi Uwe,

You can add my:
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>

Thanks,
Fabrice

> 
> diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
> index 5e48584e3bd4..009f9c1a5eca 100644
> --- a/drivers/pwm/pwm-stm32.c
> +++ b/drivers/pwm/pwm-stm32.c
> @@ -308,7 +308,7 @@ static int stm32_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,
>  	return ret;
>  }
>  
> -static int stm32_pwm_config(struct stm32_pwm *priv, int ch,
> +static int stm32_pwm_config(struct stm32_pwm *priv, unsigned int ch,
>  			    int duty_ns, int period_ns)
>  {
>  	unsigned long long prd, div, dty;
> @@ -371,7 +371,7 @@ static int stm32_pwm_config(struct stm32_pwm *priv, int ch,
>  	return 0;
>  }
>  
> -static int stm32_pwm_set_polarity(struct stm32_pwm *priv, int ch,
> +static int stm32_pwm_set_polarity(struct stm32_pwm *priv, unsigned int ch,
>  				  enum pwm_polarity polarity)
>  {
>  	u32 mask;
> @@ -386,7 +386,7 @@ static int stm32_pwm_set_polarity(struct stm32_pwm *priv, int ch,
>  	return 0;
>  }
>  
> -static int stm32_pwm_enable(struct stm32_pwm *priv, int ch)
> +static int stm32_pwm_enable(struct stm32_pwm *priv, unsigned int ch)
>  {
>  	u32 mask;
>  	int ret;
> @@ -411,7 +411,7 @@ static int stm32_pwm_enable(struct stm32_pwm *priv, int ch)
>  	return 0;
>  }
>  
> -static void stm32_pwm_disable(struct stm32_pwm *priv, int ch)
> +static void stm32_pwm_disable(struct stm32_pwm *priv, unsigned int ch)
>  {
>  	u32 mask;
>
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index 5e48584e3bd4..009f9c1a5eca 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -308,7 +308,7 @@  static int stm32_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,
 	return ret;
 }
 
-static int stm32_pwm_config(struct stm32_pwm *priv, int ch,
+static int stm32_pwm_config(struct stm32_pwm *priv, unsigned int ch,
 			    int duty_ns, int period_ns)
 {
 	unsigned long long prd, div, dty;
@@ -371,7 +371,7 @@  static int stm32_pwm_config(struct stm32_pwm *priv, int ch,
 	return 0;
 }
 
-static int stm32_pwm_set_polarity(struct stm32_pwm *priv, int ch,
+static int stm32_pwm_set_polarity(struct stm32_pwm *priv, unsigned int ch,
 				  enum pwm_polarity polarity)
 {
 	u32 mask;
@@ -386,7 +386,7 @@  static int stm32_pwm_set_polarity(struct stm32_pwm *priv, int ch,
 	return 0;
 }
 
-static int stm32_pwm_enable(struct stm32_pwm *priv, int ch)
+static int stm32_pwm_enable(struct stm32_pwm *priv, unsigned int ch)
 {
 	u32 mask;
 	int ret;
@@ -411,7 +411,7 @@  static int stm32_pwm_enable(struct stm32_pwm *priv, int ch)
 	return 0;
 }
 
-static void stm32_pwm_disable(struct stm32_pwm *priv, int ch)
+static void stm32_pwm_disable(struct stm32_pwm *priv, unsigned int ch)
 {
 	u32 mask;