Skip to content

Commit 8866f4e

Browse files
ChimstazTzung-Bi Shih
authored andcommitted
platform/chrome: cros_ec_typec: Defer probe on missing EC parent
If cros_typec_probe is called before EC device is registered, cros_typec_probe will fail. It may happen when cros-ec-typec.ko is loaded before EC bus layer module (e.g. cros_ec_lpcs.ko, cros_ec_spi.ko). Return -EPROBE_DEFER when cros_typec_probe doesn't get EC device, so the probe function can be called again after EC device is registered. Signed-off-by: Tomasz Michalec <[email protected]> Reviewed-by: Abhishek Pandit-Subedi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 19272b3 commit 8866f4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/platform/chrome/cros_ec_typec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,8 +1272,8 @@ static int cros_typec_probe(struct platform_device *pdev)
12721272

12731273
typec->ec = dev_get_drvdata(pdev->dev.parent);
12741274
if (!typec->ec) {
1275-
dev_err(dev, "couldn't find parent EC device\n");
1276-
return -ENODEV;
1275+
dev_warn(dev, "couldn't find parent EC device\n");
1276+
return -EPROBE_DEFER;
12771277
}
12781278

12791279
platform_set_drvdata(pdev, typec);

0 commit comments

Comments
 (0)