public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: pwm: remove redundant check in pwm_ops_check()
@ 2026-01-29  6:43 Ben Zong-You Xie via B4 Relay
  2026-01-29  7:19 ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Zong-You Xie via B4 Relay @ 2026-01-29  6:43 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Uwe Kleine-König, linux-pwm, linux-kernel, Ben Zong-You Xie

From: Ben Zong-You Xie <ben717@andestech.com>

Drop the redundant check for the existence of 'ops->write_waveform'.

Fixes: 17e40c25158f ("pwm: New abstraction for PWM waveforms")
Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
---
 drivers/pwm/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index ec8731515333..450aedd32c81 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -1699,8 +1699,7 @@ static bool pwm_ops_check(const struct pwm_chip *chip)
 
 	if (ops->write_waveform) {
 		if (!ops->round_waveform_tohw ||
-		    !ops->round_waveform_fromhw ||
-		    !ops->write_waveform)
+		    !ops->round_waveform_fromhw)
 			return false;
 
 		if (PWM_WFHWSIZE < ops->sizeof_wfhw) {

---
base-commit: 63faf32666e03a78cc985bcbae196418cf7d7938
change-id: 20260129-fix-pwm-ops-check-6e36ce09d75a

Best regards,
--  
Ben Zong-You Xie <ben717@andestech.com>



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

* Re: [PATCH] drivers: pwm: remove redundant check in pwm_ops_check()
  2026-01-29  6:43 [PATCH] drivers: pwm: remove redundant check in pwm_ops_check() Ben Zong-You Xie via B4 Relay
@ 2026-01-29  7:19 ` Uwe Kleine-König
  2026-01-30  5:11   ` Ben Zong-You Xie
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2026-01-29  7:19 UTC (permalink / raw)
  To: ben717; +Cc: linux-pwm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

Hello Ben,

thanks for your patch.

On Thu, Jan 29, 2026 at 02:43:34PM +0800, Ben Zong-You Xie via B4 Relay wrote:
> From: Ben Zong-You Xie <ben717@andestech.com>
> 
> Drop the redundant check for the existence of 'ops->write_waveform'.
> 
> Fixes: 17e40c25158f ("pwm: New abstraction for PWM waveforms")
> Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>

I would rewrite the commit log to:

	pwm: Remove redundant check in pwm_ops_check()

	ops->write_waveform is already known to be non-NULL so there is
	no need to check it a second time.

	The superflous check was introduced in commit 17e40c25158f
	("pwm: New abstraction for PWM waveforms").

	Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>

to make the change more clear and also to not bother the stable team
with backporting the commit to stable.

Please confirm if you're ok with this change, then I cope for the update
while applying your change.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] drivers: pwm: remove redundant check in pwm_ops_check()
  2026-01-29  7:19 ` Uwe Kleine-König
@ 2026-01-30  5:11   ` Ben Zong-You Xie
  2026-01-30 10:12     ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Zong-You Xie @ 2026-01-30  5:11 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-pwm, linux-kernel

On Thu, Jan 29, 2026 at 08:19:00AM +0100, Uwe Kleine-König wrote:
> I would rewrite the commit log to:
> 
> 	pwm: Remove redundant check in pwm_ops_check()
> 
> 	ops->write_waveform is already known to be non-NULL so there is
> 	no need to check it a second time.
> 
> 	The superflous check was introduced in commit 17e40c25158f
> 	("pwm: New abstraction for PWM waveforms").
> 
> 	Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
> 
> to make the change more clear and also to not bother the stable team
> with backporting the commit to stable.
> 
> Please confirm if you're ok with this change, then I cope for the update
> while applying your change.
> 
> Best regards
> Uwe

Hi Uwe,

I'm ok with the change, and thank you for the review.

Best regards,
Ben


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

* Re: [PATCH] drivers: pwm: remove redundant check in pwm_ops_check()
  2026-01-30  5:11   ` Ben Zong-You Xie
@ 2026-01-30 10:12     ` Uwe Kleine-König
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2026-01-30 10:12 UTC (permalink / raw)
  To: Ben Zong-You Xie; +Cc: linux-pwm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 758 bytes --]

hello Ben,

On Fri, Jan 30, 2026 at 01:11:41PM +0800, Ben Zong-You Xie wrote:
> On Thu, Jan 29, 2026 at 08:19:00AM +0100, Uwe Kleine-König wrote:
> > I would rewrite the commit log to:
> > 
> > [...]
> > 
> > to make the change more clear and also to not bother the stable team
> > with backporting the commit to stable.
> > 
> > Please confirm if you're ok with this change, then I cope for the update
> > while applying your change.
>
> I'm ok with the change, and thank you for the review.

Thanks for confirming, I applied to

	https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next

. With the merge window opening in more than a week from now I will
include it in my MR for 6.20-rc1.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2026-01-30 10:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29  6:43 [PATCH] drivers: pwm: remove redundant check in pwm_ops_check() Ben Zong-You Xie via B4 Relay
2026-01-29  7:19 ` Uwe Kleine-König
2026-01-30  5:11   ` Ben Zong-You Xie
2026-01-30 10:12     ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox