All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] pwm: bcm-kona: Use pwmchip_add() instead of pwmchip_add_with_polarity()
@ 2020-12-05 16:51 Uwe Kleine-König
  2020-12-05 16:51 ` [PATCH 2/3] pwm: atmel-hlcdc: " Uwe Kleine-König
  2020-12-05 16:51 ` [PATCH 3/3] pwm: Drop function pwmchip_add_with_polarity() Uwe Kleine-König
  0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2020-12-05 16:51 UTC (permalink / raw)
  To: Thierry Reding, Lee Jones; +Cc: linux-pwm

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-07 13:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-05 16:51 [PATCH 1/3] pwm: bcm-kona: Use pwmchip_add() instead of pwmchip_add_with_polarity() Uwe Kleine-König
2020-12-05 16:51 ` [PATCH 2/3] pwm: atmel-hlcdc: " Uwe Kleine-König
2020-12-05 16:51 ` [PATCH 3/3] pwm: Drop function pwmchip_add_with_polarity() Uwe Kleine-König
2020-12-07 13:38   ` Uwe Kleine-König

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.