linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_typec: Check for EC driver
@ 2022-04-04  4:11 Akihiko Odaki
  2022-04-05  1:57 ` Guenter Roeck
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Akihiko Odaki @ 2022-04-04  4:11 UTC (permalink / raw)
  Cc: linux-kernel, chrome-platform, Prashant Malani, Benson Leung,
	Guenter Roeck, Akihiko Odaki

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>
---
 drivers/platform/chrome/cros_ec_typec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 4bd2752c0823..7cb2e35c4ded 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -1084,6 +1084,9 @@ static int cros_typec_probe(struct platform_device *pdev)
 	}
 
 	ec_dev = dev_get_drvdata(&typec->ec->ec->dev);
+	if (!ec_dev)
+		return -EPROBE_DEFER;
+
 	typec->typec_cmd_supported = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD);
 	typec->needs_mux_ack = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK);
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-05-12 17:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04  4:11 [PATCH] platform/chrome: cros_ec_typec: Check for EC driver Akihiko Odaki
2022-04-05  1:57 ` Guenter Roeck
2022-04-05  5:43   ` Akihiko Odaki
2022-04-06 21:16 ` Prashant Malani
2022-04-06 21:32   ` Guenter Roeck
2022-04-07  1:16     ` Akihiko Odaki
2022-04-07 16:28       ` Guenter Roeck
2022-04-07 17:03         ` Akihiko Odaki
2022-04-07 17:09           ` Benson Leung
2022-04-07 17:23             ` Akihiko Odaki
2022-04-07 18:51             ` Guenter Roeck
2022-04-20 10:50 ` patchwork-bot+chrome-platform
2022-05-10 23:00 ` patchwork-bot+chrome-platform
2022-05-12 17:20 ` patchwork-bot+chrome-platform

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).