platform/chrome: Centralize cros_ec_device allocation
authorTzung-Bi Shih <tzungbi@kernel.org>
Thu, 28 Aug 2025 08:35:57 +0000 (08:35 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Sun, 14 Sep 2025 03:34:41 +0000 (11:34 +0800)
commit918856986014142271a70a334d300994b9c41720
tree9bd31c49c6fd2be28ed450b75ca7cbb45fb3b2f6
parentf7439a723e5aa5b35c76355e1b9b2cd1108f656e
platform/chrome: Centralize cros_ec_device allocation

Introduce a helper function, cros_ec_device_alloc(), to centralize the
allocation of the struct cros_ec_device.  Convert all protocol device
drivers to use this new function.

This is a preparatory step for separating common initialization logic
out of device drivers' probe() and cros_ec_register().

Link: https://lore.kernel.org/r/20250828083601.856083-2-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_ec.c
drivers/platform/chrome/cros_ec.h
drivers/platform/chrome/cros_ec_i2c.c
drivers/platform/chrome/cros_ec_ishtp.c
drivers/platform/chrome/cros_ec_lpc.c
drivers/platform/chrome/cros_ec_rpmsg.c
drivers/platform/chrome/cros_ec_spi.c
drivers/platform/chrome/cros_ec_uart.c