Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20220404041101.6276-1-akihiko.odaki@gmail.com
Signed-off-by: Prashant Malani <pmalani@chromium.org>

authored by

Akihiko Odaki and committed by
Prashant Malani
7464ff8b c9bc1a0e

+3
+3
drivers/platform/chrome/cros_ec_typec.c
··· 1084 1084 } 1085 1085 1086 1086 ec_dev = dev_get_drvdata(&typec->ec->ec->dev); 1087 + if (!ec_dev) 1088 + return -EPROBE_DEFER; 1089 + 1087 1090 typec->typec_cmd_supported = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD); 1088 1091 typec->needs_mux_ack = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK); 1089 1092