All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: typec: hd3ss3220: fix VBUS regulator error message
@ 2026-08-07  8:14 raoxu
  2026-08-12  9:06 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: raoxu @ 2026-08-07  8:14 UTC (permalink / raw)
  To: heikki.krogerus; +Cc: gregkh, linux-usb, linux-kernel, raoxu

From: Xu Rao <raoxu@uniontech.com>

hd3ss3220_regulator_control() enables the VBUS regulator when @on is
true and disables it when @on is false.  However, its error message uses
the opposite operation name, so an enable failure is reported as a
disable failure and vice versa.

Print the operation that was actually attempted.  Reporting the opposite
regulator operation on failures can mislead debugging of VBUS problems.

Fixes: 27fbc19e52b9 ("usb: typec: hd3ss3220: Enable VBUS based on role state")
Signed-off-by: Xu Rao <raoxu@uniontech.com>
---
 drivers/usb/typec/hd3ss3220.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c
index 3e39b800e6b5..d0de5a2488f9 100644
--- a/drivers/usb/typec/hd3ss3220.c
+++ b/drivers/usb/typec/hd3ss3220.c
@@ -218,7 +218,7 @@ static void hd3ss3220_regulator_control(struct hd3ss3220 *hd3ss3220, bool on)
 
 	if (ret)
 		dev_err(hd3ss3220->dev,
-			"vbus regulator %s failed: %d\n", on ? "disable" : "enable", ret);
+			"vbus regulator %s failed: %d\n", on ? "enable" : "disable", ret);
 }
 
 static void hd3ss3220_set_role(struct hd3ss3220 *hd3ss3220)
-- 
2.50.1


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

* Re: [PATCH] usb: typec: hd3ss3220: fix VBUS regulator error message
  2026-08-07  8:14 [PATCH] usb: typec: hd3ss3220: fix VBUS regulator error message raoxu
@ 2026-08-12  9:06 ` Heikki Krogerus
  0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2026-08-12  9:06 UTC (permalink / raw)
  To: raoxu; +Cc: gregkh, linux-usb, linux-kernel

On Fri, Aug 07, 2026 at 04:14:22PM +0800, raoxu wrote:
> From: Xu Rao <raoxu@uniontech.com>
> 
> hd3ss3220_regulator_control() enables the VBUS regulator when @on is
> true and disables it when @on is false.  However, its error message uses
> the opposite operation name, so an enable failure is reported as a
> disable failure and vice versa.
> 
> Print the operation that was actually attempted.  Reporting the opposite
> regulator operation on failures can mislead debugging of VBUS problems.
> 
> Fixes: 27fbc19e52b9 ("usb: typec: hd3ss3220: Enable VBUS based on role state")
> Signed-off-by: Xu Rao <raoxu@uniontech.com>

Please CC stable. With that fixed:

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/hd3ss3220.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c
> index 3e39b800e6b5..d0de5a2488f9 100644
> --- a/drivers/usb/typec/hd3ss3220.c
> +++ b/drivers/usb/typec/hd3ss3220.c
> @@ -218,7 +218,7 @@ static void hd3ss3220_regulator_control(struct hd3ss3220 *hd3ss3220, bool on)
>  
>  	if (ret)
>  		dev_err(hd3ss3220->dev,
> -			"vbus regulator %s failed: %d\n", on ? "disable" : "enable", ret);
> +			"vbus regulator %s failed: %d\n", on ? "enable" : "disable", ret);
>  }
>  
>  static void hd3ss3220_set_role(struct hd3ss3220 *hd3ss3220)
> -- 
> 2.50.1

-- 
heikki

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

end of thread, other threads:[~2026-08-12  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07  8:14 [PATCH] usb: typec: hd3ss3220: fix VBUS regulator error message raoxu
2026-08-12  9:06 ` Heikki Krogerus

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.