diff mbox series

usb: typec: tipd: Remove dependency on "connector" child fwnode

Message ID 20210930124758.23233-1-heikki.krogerus@linux.intel.com (mailing list archive)
State Accepted
Commit b87d8d0d4c43c29ccdc57d15b2ebc1df886a34b4
Headers show
Series usb: typec: tipd: Remove dependency on "connector" child fwnode | expand

Commit Message

Heikki Krogerus Sept. 30, 2021, 12:47 p.m. UTC
There is no "connector" child node available on every
platform, so the driver can't fail to probe when it's
missing.

Fixes: 57560ee95cb7 ("usb: typec: tipd: Don't block probing of consumer of "connector" nodes")
Reported-by: "Regupathy, Rajaram" <rajaram.regupathy@intel.com>
Cc: stable@vger.kernel.org # 5.14+
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/tipd/core.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 93e56291f0cf1..b30efdb9fa9ed 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -628,10 +628,6 @@  static int tps6598x_probe(struct i2c_client *client)
 	if (ret < 0)
 		return ret;
 
-	fwnode = device_get_named_child_node(&client->dev, "connector");
-	if (!fwnode)
-		return -ENODEV;
-
 	/*
 	 * This fwnode has a "compatible" property, but is never populated as a
 	 * struct device. Instead we simply parse it to read the properties.
@@ -639,7 +635,9 @@  static int tps6598x_probe(struct i2c_client *client)
 	 * with existing DT files, we work around this by deleting any
 	 * fwnode_links to/from this fwnode.
 	 */
-	fw_devlink_purge_absent_suppliers(fwnode);
+	fwnode = device_get_named_child_node(&client->dev, "connector");
+	if (fwnode)
+		fw_devlink_purge_absent_suppliers(fwnode);
 
 	tps->role_sw = fwnode_usb_role_switch_get(fwnode);
 	if (IS_ERR(tps->role_sw)) {