diff mbox series

[v3,1/1] usb: typec: ucsi: Don't warn on probe deferral

Message ID 20220927134512.2651067-1-waynec@nvidia.com (mailing list archive)
State Accepted
Commit fce703a991b7e8c7e1371de95b9abaa832ecf9c3
Headers show
Series [v3,1/1] usb: typec: ucsi: Don't warn on probe deferral | expand

Commit Message

Wayne Chang Sept. 27, 2022, 1:45 p.m. UTC
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.

Signed-off-by: Wayne Chang <waynec@nvidia.com>
--
V2 -> V3: remove the Fixes and Cc
V1 -> V2: adjust the coding style for better reading format.
 drivers/usb/typec/ucsi/ucsi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Heikki Krogerus Sept. 28, 2022, 6:23 a.m. UTC | #1
On Tue, Sep 27, 2022 at 09:45:12PM +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.
> 
> Signed-off-by: Wayne Chang <waynec@nvidia.com>

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

> --
> V2 -> V3: remove the Fixes and Cc
> 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);

thanks,
diff mbox series

Patch

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