All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm: Return -EINVAL for old-style drivers without .set_polarity callback
@ 2021-03-01 18:23 Uwe Kleine-König
  2021-03-22 10:55 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2021-03-01 18:23 UTC (permalink / raw)
  To: Thierry Reding, Lee Jones; +Cc: linux-pwm, kernel

Since commit 2b1c1a5d5148 ("pwm: Use -EINVAL for unsupported polarity")
all drivers implementing the apply callback are unified to return
-EINVAL if an unsupported polarity is requested. Do the same in the
compat code for old-style drivers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index a8eff4b3ee36..8e1f97f2e049 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -607,7 +607,7 @@ int pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state)
 		 */
 		if (state->polarity != pwm->state.polarity) {
 			if (!chip->ops->set_polarity)
-				return -ENOTSUPP;
+				return -EINVAL;
 
 			/*
 			 * Changing the polarity of a running PWM is
-- 
2.30.0


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

* Re: [PATCH] pwm: Return -EINVAL for old-style drivers without .set_polarity callback
  2021-03-01 18:23 [PATCH] pwm: Return -EINVAL for old-style drivers without .set_polarity callback Uwe Kleine-König
@ 2021-03-22 10:55 ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2021-03-22 10:55 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Lee Jones, linux-pwm, kernel

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

On Mon, Mar 01, 2021 at 07:23:07PM +0100, Uwe Kleine-König wrote:
> Since commit 2b1c1a5d5148 ("pwm: Use -EINVAL for unsupported polarity")
> all drivers implementing the apply callback are unified to return
> -EINVAL if an unsupported polarity is requested. Do the same in the
> compat code for old-style drivers.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/pwm/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thierry

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

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

end of thread, other threads:[~2021-03-22 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 18:23 [PATCH] pwm: Return -EINVAL for old-style drivers without .set_polarity callback Uwe Kleine-König
2021-03-22 10:55 ` Thierry Reding

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.