platform/chrome: cros_ec: Add a flag to track registration state
authorTzung-Bi Shih <tzungbi@kernel.org>
Thu, 28 Aug 2025 08:36:00 +0000 (08:36 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Sun, 14 Sep 2025 03:34:41 +0000 (11:34 +0800)
commit56cb557279d70397cefb497e0f06bdd6fd685f8e
treea863b7f72ea4e475ae1363a96da57e4cad1a9687
parent7a79b0bfd8b3995a39d25bffcf57273635c0e542
platform/chrome: cros_ec: Add a flag to track registration state

Introduce a `registered` flag to the `struct cros_ec_device` to allow
callers to determine if the device has been fully registered and is
ready for use.

This is a preparatory step to prevent race conditions where other drivers
might try to access the device before it is fully registered or after
it has been unregistered.

Link: https://lore.kernel.org/r/20250828083601.856083-5-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_ec.c
drivers/platform/chrome/cros_ec_proto.c
include/linux/platform_data/cros_ec_proto.h