Skip to contentSkip to conversation

usb: typec: ucsi: Don't warn on probe deferral

PATCH In review Wayne Chang 2 participants 2 messages Sep 27, 2022 – Sep 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 usb: typec: ucsi: Don't warn on probe deferral

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.

--
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(-)
drivers/usb/typec/ucsi/ucsi.c +3 -5
index 7f2624f42724..e961ebecd7df 100644
@@ -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);
Signature · 1 line
2.25.1
maintainer Acked-by on v3 1/1
#1 lore raw
Quoted 5 lines · Wayne Chang

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.

Quoted 15 lines

--
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(-)
drivers/usb/typec/ucsi/ucsi.c +0 -1
index 7f2624f42724..e961ebecd7df 100644
@@ -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)) {

drivers/usb/typec/ucsi/ucsi.c static int ucsi_register_port(struct ucsi *ucsi, int index) · line 1077

Quoted 10 lines
drivers/usb/typec/ucsi/ucsi.c +3 -4
-		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,

Signature · 1 line
heikki