summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorTomasz Michalec <tmichalec@google.com>2025-06-10 18:37:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-28 17:24:19 +0300
commita73ccab0ebd2858dbd61a45debd3300ea28dbe75 (patch)
tree7b7fcdd42475c768c71aacaa1149cbdf0aecb792 /drivers/platform
parent93d700f59bf99a56f8e9b585c32421855b1ceb17 (diff)
downloadlinux-a73ccab0ebd2858dbd61a45debd3300ea28dbe75.tar.xz
platform/chrome: cros_ec_typec: Defer probe on missing EC parent
[ Upstream commit 8866f4e557eba43e991f99711515217a95f62d2e ] 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 <tmichalec@google.com> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> Link: https://lore.kernel.org/r/20250610153748.1858519-1-tmichalec@google.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/chrome/cros_ec_typec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index c065963b9a42..6f3fdd38c393 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -1110,8 +1110,8 @@ static int cros_typec_probe(struct platform_device *pdev)
typec->ec = dev_get_drvdata(pdev->dev.parent);
if (!typec->ec) {
- dev_err(dev, "couldn't find parent EC device\n");
- return -ENODEV;
+ dev_warn(dev, "couldn't find parent EC device\n");
+ return -EPROBE_DEFER;
}
platform_set_drvdata(pdev, typec);