linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] usb: typec: ucsi: Don't warn on probe deferral
@ 2022-09-27 12:29 Wayne Chang
  2022-09-27 12:40 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Wayne Chang @ 2022-09-27 12:29 UTC (permalink / raw)
  To: heikki.krogerus, gregkh
  Cc: quic_linyyuan, quic_jackp, saranya.gopal, tiwai, linux-usb,
	linux-kernel, waynec, stable

Deferred probe is an expected return value for fwnode_usb_role_switch_get().
Given that the driver deals with it properly, there's no need to output a
warning that may potentially confuse users.

Fixes: 3c162511530c ("usb: typec: ucsi: Wait for the USB role switches")
Cc: stable@vger.kernel.org
Signed-off-by: Wayne Chang <waynec@nvidia.com>
---
V1 -> V2: adjust the coding style for better reading format.
 drivers/usb/typec/ucsi/ucsi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 7f2624f42724..e961ebecd7df 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1069,11 +1069,9 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
 
 	cap->fwnode = ucsi_find_fwnode(con);
 	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
-	if (IS_ERR(con->usb_role_sw)) {
-		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
-			con->num);
-		return PTR_ERR(con->usb_role_sw);
-	}
+	if (IS_ERR(con->usb_role_sw))
+		return dev_err_probe(ucsi->dev, PTR_ERR(con->usb_role_sw),
+			"con%d: failed to get usb role switch\n", con->num);
 
 	/* Delay other interactions with the con until registration is complete */
 	mutex_lock(&con->lock);
-- 
2.25.1


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

* Re: [PATCH v2 1/1] usb: typec: ucsi: Don't warn on probe deferral
  2022-09-27 12:29 [PATCH v2 1/1] usb: typec: ucsi: Don't warn on probe deferral Wayne Chang
@ 2022-09-27 12:40 ` Greg KH
  2022-09-27 13:43   ` Wayne Chang
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2022-09-27 12:40 UTC (permalink / raw)
  To: Wayne Chang
  Cc: heikki.krogerus, quic_linyyuan, quic_jackp, saranya.gopal, tiwai,
	linux-usb, linux-kernel, stable

On Tue, Sep 27, 2022 at 08:29:13PM +0800, Wayne Chang wrote:
> Deferred probe is an expected return value for fwnode_usb_role_switch_get().
> Given that the driver deals with it properly, there's no need to output a
> warning that may potentially confuse users.
> 
> Fixes: 3c162511530c ("usb: typec: ucsi: Wait for the USB role switches")
> Cc: stable@vger.kernel.org

Why is this a bugfix that needs to be backported?  The current code
works the same as what you are changing it to be, there's no functional
difference, right?

thanks,

greg k-h

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

* Re: [PATCH v2 1/1] usb: typec: ucsi: Don't warn on probe deferral
  2022-09-27 12:40 ` Greg KH
@ 2022-09-27 13:43   ` Wayne Chang
  0 siblings, 0 replies; 3+ messages in thread
From: Wayne Chang @ 2022-09-27 13:43 UTC (permalink / raw)
  To: Greg KH
  Cc: heikki.krogerus, quic_linyyuan, quic_jackp, saranya.gopal, tiwai,
	linux-usb, linux-kernel, stable

Hi Greg,

Thanks for the review.

On 9/27/22 20:40, Greg KH wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Tue, Sep 27, 2022 at 08:29:13PM +0800, Wayne Chang wrote:
>> Deferred probe is an expected return value for fwnode_usb_role_switch_get().
>> Given that the driver deals with it properly, there's no need to output a
>> warning that may potentially confuse users.
>>
>> Fixes: 3c162511530c ("usb: typec: ucsi: Wait for the USB role switches")
>> Cc: stable@vger.kernel.org
> 
> Why is this a bugfix that needs to be backported?  The current code
> works the same as what you are changing it to be, there's no functional
> difference, right?
> 
> thanks,
> 
> greg k-h
> 

Yes, there's no functional difference but clears probe deferral warnings.
I'll send v3 to remove them.

thanks,
Wayne.

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

end of thread, other threads:[~2022-09-27 13:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 12:29 [PATCH v2 1/1] usb: typec: ucsi: Don't warn on probe deferral Wayne Chang
2022-09-27 12:40 ` Greg KH
2022-09-27 13:43   ` Wayne Chang

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).