diff options
author | Tzung-Bi Shih <tzungbi@kernel.org> | 2025-08-28 11:35:58 +0300 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2025-09-14 06:34:41 +0300 |
commit | e19ceeb1c0f63e3e15b197c5f34797134b51ba0e (patch) | |
tree | 3737c3fd556834d10f91e43f5fb38623884984d3 /drivers/platform/chrome/cros_ec_uart.c | |
parent | 918856986014142271a70a334d300994b9c41720 (diff) | |
download | linux-e19ceeb1c0f63e3e15b197c5f34797134b51ba0e.tar.xz |
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>
Diffstat (limited to 'drivers/platform/chrome/cros_ec_uart.c')
-rw-r--r-- | drivers/platform/chrome/cros_ec_uart.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/platform/chrome/cros_ec_uart.c b/drivers/platform/chrome/cros_ec_uart.c index 1a7511b1bbe3..d5b37414ff12 100644 --- a/drivers/platform/chrome/cros_ec_uart.c +++ b/drivers/platform/chrome/cros_ec_uart.c @@ -276,14 +276,10 @@ static int cros_ec_uart_probe(struct serdev_device *serdev) /* Initialize ec_dev for cros_ec */ ec_dev->phys_name = dev_name(dev); - ec_dev->dev = dev; ec_dev->priv = ec_uart; ec_dev->irq = ec_uart->irq; ec_dev->cmd_xfer = NULL; ec_dev->pkt_xfer = cros_ec_uart_pkt_xfer; - ec_dev->din_size = sizeof(struct ec_host_response) + - sizeof(struct ec_response_get_protocol_info); - ec_dev->dout_size = sizeof(struct ec_host_request) + sizeof(struct ec_params_rwsig_action); serdev_device_set_client_ops(serdev, &cros_ec_uart_client_ops); |