summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome
diff options
context:
space:
mode:
authorTomasz Michalec <tmichalec@google.com>2025-06-10 17:37:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-28 16:28:19 +0200
commit7731b7d596c5491188b03a1e15a33d0797081fe4 (patch)
tree7735e3a8eedd45ee323decef9133146539170767 /drivers/platform/chrome
parent8c046583a2344defe0b6956bf7e535b270a1e03f (diff)
downloadlinux-7731b7d596c5491188b03a1e15a33d0797081fe4.tar.gz
linux-7731b7d596c5491188b03a1e15a33d0797081fe4.tar.bz2
linux-7731b7d596c5491188b03a1e15a33d0797081fe4.zip
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/chrome')
-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 66fdc6fa73ec..76807ceb313a 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -1179,8 +1179,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);