From: Prashant Malani Date: Wed, 4 Jan 2023 06:08:45 +0000 (+0000) Subject: platform/chrome: cros_typec_switch: Check for retimer flag X-Git-Tag: v6.6.7~3241^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=441529bed41cd6f368fe337ebbb4920e3519da24;p=platform%2Fkernel%2Flinux-starfive.git platform/chrome: cros_typec_switch: Check for retimer flag Not all ports have retimers. Only register a retimer switch if the "retimer-switch" property is present for that port's mux device. Signed-off-by: Prashant Malani Reviewed-by: Benson Leung Link: https://lore.kernel.org/r/20230104060846.112216-2-pmalani@chromium.org --- diff --git a/drivers/platform/chrome/cros_typec_switch.c b/drivers/platform/chrome/cros_typec_switch.c index 2536bda..9ed1605f 100644 --- a/drivers/platform/chrome/cros_typec_switch.c +++ b/drivers/platform/chrome/cros_typec_switch.c @@ -246,14 +246,16 @@ static int cros_typec_register_switches(struct cros_typec_switch_data *sdata) port->port_num = index; sdata->ports[index] = port; - ret = cros_typec_register_retimer(port, fwnode); - if (ret) { - dev_err(dev, "Retimer switch register failed\n"); - goto err_switch; + if (fwnode_property_present(fwnode, "retimer-switch")) { + ret = cros_typec_register_retimer(port, fwnode); + if (ret) { + dev_err(dev, "Retimer switch register failed\n"); + goto err_switch; + } + + dev_dbg(dev, "Retimer switch registered for index %llu\n", index); } - dev_dbg(dev, "Retimer switch registered for index %llu\n", index); - if (!fwnode_property_present(fwnode, "mode-switch")) continue;