Skip to content

Commit 84adb88

Browse files
akihikodakigregkh
authored andcommitted
platform/chrome: cros_ec_typec: Check for EC driver
commit 7464ff8 upstream. 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 <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Prashant Malani <[email protected]> Signed-off-by: Laura Nao <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 542532a commit 84adb88

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/platform/chrome/cros_ec_typec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,9 @@ static int cros_typec_probe(struct platform_device *pdev)
11231123
}
11241124

11251125
ec_dev = dev_get_drvdata(&typec->ec->ec->dev);
1126+
if (!ec_dev)
1127+
return -EPROBE_DEFER;
1128+
11261129
typec->typec_cmd_supported = !!cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD);
11271130
typec->needs_mux_ack = !!cros_ec_check_features(ec_dev,
11281131
EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK);

0 commit comments

Comments
 (0)