From: Matt Davis <mattedavis@google.com>
To: "Abhishek Pandit-Subedi" <abhishekpandit@chromium.org>,
"Łukasz Bartosik" <ukaszb@chromium.org>,
"Jameson Thies" <jthies@google.com>,
"Andrei Kuchynski" <akuchynski@chromium.org>,
"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Benson Leung" <bleung@chromium.org>
Cc: Guenter Roeck <groeck@chromium.org>,
chrome-platform@lists.linux.dev, linux-usb@vger.kernel.org,
Matt Davis <mattedavis@google.com>
Subject: [PATCH] usb: typec: ucsi: Defer cros_ec_ucsi probe until EC is registered
Date: Thu, 3 Dec 2026 14:45:44 -0800 [thread overview]
Message-ID: <20261203224544.3225503-1-mattedavis@google.com> (raw)
When bound via OF or ACPI, cros_ec_ucsi can probe before the parent EC
driver sets drvdata or finishes cros_ec_register(). Defer probe until
the parent EC device is registered instead of failing with -ENODEV.
Fixes: 40b17a345d3f ("usb: typec: cros_ec_ucsi: Load driver from OF and ACPI definitions")
Signed-off-by: Matt Davis <mattedavis@google.com>
---
drivers/usb/typec/ucsi/cros_ec_ucsi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/ucsi/cros_ec_ucsi.c b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
index 1a052524ed83..1e7bd832ad39 100644
--- a/drivers/usb/typec/ucsi/cros_ec_ucsi.c
+++ b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
@@ -277,8 +277,8 @@ static int cros_ucsi_probe(struct platform_device *pdev)
else
udata->ec = ((struct cros_ec_dev *)dev_get_drvdata(dev->parent))->ec_dev;
- if (!udata->ec)
- return dev_err_probe(dev, -ENODEV, "couldn't find parent EC device\n");
+ if (!udata->ec || !cros_ec_device_registered(udata->ec))
+ return dev_err_probe(dev, -EPROBE_DEFER, "couldn't find parent EC device\n");
platform_set_drvdata(pdev, udata);
--
2.56.1.915.g69d5ec7298-goog
next reply other threads:[~2026-12-03 22:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 22:45 Matt Davis [this message]
2026-12-03 23:01 ` [PATCH] usb: typec: ucsi: Defer cros_ec_ucsi probe until EC is registered sashiko-bot
2026-12-04 0:42 ` Jameson Thies
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203224544.3225503-1-mattedavis@google.com \
--to=mattedavis@google.com \
--cc=abhishekpandit@chromium.org \
--cc=akuchynski@chromium.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=groeck@chromium.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jthies@google.com \
--cc=linux-usb@vger.kernel.org \
--cc=ukaszb@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.