linux-pwm.vger.kernel.org archive mirror
 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 1/3] pwm: bcm-kona: Use pwmchip_add() instead of pwmchip_add_with_polarity()
Date: Mon,  7 Dec 2020 14:45:54 +0100	[thread overview]
Message-ID: <20201207134556.25217-2-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).

The eventual goal is to remove pwmchip_add_with_polarity() and so simplify
the data flow in the PWM core.

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

diff --git a/drivers/pwm/pwm-bcm-kona.c b/drivers/pwm/pwm-bcm-kona.c
index 16c5898b934a..40ecfb2bb632 100644
--- a/drivers/pwm/pwm-bcm-kona.c
+++ b/drivers/pwm/pwm-bcm-kona.c
@@ -303,7 +303,7 @@ static int kona_pwmc_probe(struct platform_device *pdev)
 
 	clk_disable_unprepare(kp->clk);
 
-	ret = pwmchip_add_with_polarity(&kp->chip, PWM_POLARITY_INVERSED);
+	ret = pwmchip_add(&kp->chip);
 	if (ret < 0)
 		dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret);
 
-- 
2.29.2


  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 ` Uwe Kleine-König [this message]
2021-03-22 11:27   ` [PATCH v2 1/3] pwm: bcm-kona: Use pwmchip_add() instead " Thierry Reding
2020-12-07 13:45 ` [PATCH v2 2/3] pwm: atmel-hlcdc: " Uwe Kleine-König
2021-03-22 11:31   ` 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-2-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).