@@ -264,7 +264,14 @@ static int hd3ss3220_probe(struct i2c_client *client)
typec_cap.type = TYPEC_PORT_DRP;
typec_cap.data = TYPEC_PORT_DRD;
typec_cap.ops = &hd3ss3220_ops;
- typec_cap.fwnode = connector;
+
+ /*
+ * Try to get properties from connector,
+ * but continue with defaults anyway if they are not found
+ */
+ ret = typec_get_fw_cap(&typec_cap, connector);
+ if (ret != 0 && ret != -EINVAL && ret != -ENXIO)
+ goto err_put_role;
hd3ss3220->port = typec_register_port(&client->dev, &typec_cap);
if (IS_ERR(hd3ss3220->port)) {
The type, data, and prefer_role properties were previously hard-coded when creating the struct typec_capability. Use typec_get_fw_cap() to populate these fields based on the respective fwnode properties, if present. Signed-off-by: Oliver Facklam <oliver.facklam@zuehlke.com> --- drivers/usb/typec/hd3ss3220.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)