]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
platform/chrome: Centralize common cros_ec_device initialization
authorTzung-Bi Shih <tzungbi@kernel.org>
Thu, 28 Aug 2025 08:35:58 +0000 (08:35 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Sun, 14 Sep 2025 03:34:41 +0000 (11:34 +0800)
commite19ceeb1c0f63e3e15b197c5f34797134b51ba0e
tree3737c3fd556834d10f91e43f5fb38623884984d3
parent918856986014142271a70a334d300994b9c41720
platform/chrome: Centralize common cros_ec_device initialization

Move the common initialization from protocol device drivers into central
cros_ec_device_alloc().

This removes duplicated code from each driver's probe function.
The buffer sizes are now calculated once, using the maximum possible
overhead required by any of the transport protocols, ensuring the
allocated buffers are sufficient for all cases.

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