All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <uwe@kleine-koenig.org>
To: Thierry Reding <thierry.reding@gmail.com>,
	Lee Jones <lee.jones@linaro.org>
Cc: linux-pwm@vger.kernel.org
Subject: [PATCH v2 2/3] pwm: atmel-hlcdc: Use pwmchip_add() instead of pwmchip_add_with_polarity()
Date: Mon,  7 Dec 2020 14:45:55 +0100	[thread overview]
Message-ID: <20201207134556.25217-3-uwe@kleine-koenig.org> (raw)
In-Reply-To: <20201207134556.25217-1-uwe@kleine-koenig.org>

The only side effect of this change is that pwm->state.polarity is
initialized to PWM_POLARITY_NORMAL instead of PWM_POLARITY_INVERSED.
However all other members of pwm->state are uninitialized and consumers
are expected to provide the right polarity (either by setting it explicitly
or by using a helper like pwm_init_state() that overwrites .polarity
anyhow with a value independent of the initial value).

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
 drivers/pwm/pwm-atmel-hlcdc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-atmel-hlcdc.c b/drivers/pwm/pwm-atmel-hlcdc.c
index dcbc0489dfd4..4551aa2c484c 100644
--- a/drivers/pwm/pwm-atmel-hlcdc.c
+++ b/drivers/pwm/pwm-atmel-hlcdc.c
@@ -270,7 +270,7 @@ static int atmel_hlcdc_pwm_probe(struct platform_device *pdev)
 	chip->chip.of_xlate = of_pwm_xlate_with_flags;
 	chip->chip.of_pwm_n_cells = 3;
 
-	ret = pwmchip_add_with_polarity(&chip->chip, PWM_POLARITY_INVERSED);
+	ret = pwmchip_add(&chip->chip);
 	if (ret) {
 		clk_disable_unprepare(hlcdc->periph_clk);
 		return ret;
-- 
2.29.2


  parent reply	other threads:[~2020-12-07 13:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 13:45 [PATCH v2 0/3] pwm: get rid of pwmchip_add_with_polarity() Uwe Kleine-König
2020-12-07 13:45 ` [PATCH v2 1/3] pwm: bcm-kona: Use pwmchip_add() instead " Uwe Kleine-König
2021-03-22 11:27   ` Thierry Reding
2020-12-07 13:45 ` Uwe Kleine-König [this message]
2021-03-22 11:31   ` [PATCH v2 2/3] pwm: atmel-hlcdc: " Thierry Reding
2020-12-07 13:45 ` [PATCH v2 3/3] pwm: Drop function pwmchip_add_with_polarity() Uwe Kleine-König
2021-03-22 11:32   ` Thierry Reding
2021-03-22 15:50     ` Uwe Kleine-König

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=20201207134556.25217-3-uwe@kleine-koenig.org \
    --to=uwe@kleine-koenig.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.