Linux PWM subsystem development
 help / color / mirror / Atom feed
From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@microchip.com>
Cc: linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	kernel@pengutronix.de
Subject: Re: [PATCH 4/5] pwm: atmel-tcb: Unroll atmel_tcb_pwm_set_polarity() into only caller
Date: Thu, 27 Jul 2023 08:59:45 +0300	[thread overview]
Message-ID: <6ec02864-6e18-d2c7-3ad6-e3c2c3df73e8@tuxon.dev> (raw)
In-Reply-To: <20230719192013.4051193-5-u.kleine-koenig@pengutronix.de>



On 19.07.2023 22:20, Uwe Kleine-König wrote:
> atmel_tcb_pwm_set_polarity() is only called once and effectively wraps
> an assignment only. Replace the function call by the respective
> assignment.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>

> ---
>   drivers/pwm/pwm-atmel-tcb.c | 17 +++--------------
>   1 file changed, 3 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c
> index ae274bd7907d..32a60d7f8ed2 100644
> --- a/drivers/pwm/pwm-atmel-tcb.c
> +++ b/drivers/pwm/pwm-atmel-tcb.c
> @@ -68,18 +68,6 @@ static inline struct atmel_tcb_pwm_chip *to_tcb_chip(struct pwm_chip *chip)
>   	return container_of(chip, struct atmel_tcb_pwm_chip, chip);
>   }
>   
> -static int atmel_tcb_pwm_set_polarity(struct pwm_chip *chip,
> -				      struct pwm_device *pwm,
> -				      enum pwm_polarity polarity)
> -{
> -	struct atmel_tcb_pwm_chip *tcbpwmc = to_tcb_chip(chip);
> -	struct atmel_tcb_pwm_device *tcbpwm = &tcbpwmc->pwms[pwm->hwpwm];
> -
> -	tcbpwm->polarity = polarity;
> -
> -	return 0;
> -}
> -
>   static int atmel_tcb_pwm_request(struct pwm_chip *chip,
>   				 struct pwm_device *pwm)
>   {
> @@ -357,11 +345,12 @@ static int atmel_tcb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
>   static int atmel_tcb_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
>   			       const struct pwm_state *state)
>   {
> +	struct atmel_tcb_pwm_chip *tcbpwmc = to_tcb_chip(chip);
> +	struct atmel_tcb_pwm_device *tcbpwm = &tcbpwmc->pwms[pwm->hwpwm];
>   	int duty_cycle, period;
>   	int ret;
>   
> -	/* This function only sets a flag in driver data */
> -	atmel_tcb_pwm_set_polarity(chip, pwm, state->polarity);
> +	tcbpwm->polarity = state->polarity;
>   
>   	if (!state->enabled) {
>   		atmel_tcb_pwm_disable(chip, pwm);

  reply	other threads:[~2023-07-27  5:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 19:20 [PATCH 0/5] pwm: atmel-tcb: Some driver maintenance Uwe Kleine-König
2023-07-19 19:20 ` [PATCH 1/5] pwm: atmel-tcb: Harmonize resource allocation order Uwe Kleine-König
2023-07-27  6:00   ` claudiu beznea
2023-07-27  7:00     ` Uwe Kleine-König
2023-07-19 19:20 ` [PATCH 2/5] pwm: atmel-tcb: Fix resource freeing in error path and remove Uwe Kleine-König
2023-07-27  6:00   ` claudiu beznea
2023-07-19 19:20 ` [PATCH 3/5] pwm: atmel-tcb: Put per-channel data into driver data Uwe Kleine-König
2023-07-27  5:59   ` claudiu beznea
2023-07-19 19:20 ` [PATCH 4/5] pwm: atmel-tcb: Unroll atmel_tcb_pwm_set_polarity() into only caller Uwe Kleine-König
2023-07-27  5:59   ` claudiu beznea [this message]
2023-07-19 19:20 ` [PATCH 5/5] pwm: atmel-tcb: Don't track polarity in driver data Uwe Kleine-König
2023-07-27  5:59   ` claudiu beznea
2023-07-28  7:36 ` [PATCH 0/5] pwm: atmel-tcb: Some driver maintenance Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ec02864-6e18-d2c7-3ad6-e3c2c3df73e8@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox