Commit 7464ff8b authored by Akihiko Odaki's avatar Akihiko Odaki Committed by Prashant Malani

platform/chrome: cros_ec_typec: Check for EC driver

The EC driver may not be initialized when cros_typec_probe is called,
particulary when CONFIG_CROS_EC_CHARDEV=m.
Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20220404041101.6276-1-akihiko.odaki@gmail.comSigned-off-by: default avatarPrashant Malani <pmalani@chromium.org>
parent c9bc1a0e
......@@ -1084,6 +1084,9 @@ static int cros_typec_probe(struct platform_device *pdev)
}
ec_dev = dev_get_drvdata(&typec->ec->ec->dev);
if (!ec_dev)
return -EPROBE_DEFER;
typec->typec_cmd_supported = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD);
typec->needs_mux_ack = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment