summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome/cros_ec_ishtp.c
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@kernel.org>2025-08-28 11:35:58 +0300
committerTzung-Bi Shih <tzungbi@kernel.org>2025-09-14 06:34:41 +0300
commite19ceeb1c0f63e3e15b197c5f34797134b51ba0e (patch)
tree3737c3fd556834d10f91e43f5fb38623884984d3 /drivers/platform/chrome/cros_ec_ishtp.c
parent918856986014142271a70a334d300994b9c41720 (diff)
downloadlinux-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_ishtp.c')
-rw-r--r--drivers/platform/chrome/cros_ec_ishtp.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c
index c102a796670c..4e74e702c5a2 100644
--- a/drivers/platform/chrome/cros_ec_ishtp.c
+++ b/drivers/platform/chrome/cros_ec_ishtp.c
@@ -550,14 +550,10 @@ static int cros_ec_dev_init(struct ishtp_cl_data *client_data)
client_data->ec_dev = ec_dev;
dev->driver_data = ec_dev;
- ec_dev->dev = dev;
ec_dev->priv = client_data->cros_ish_cl;
ec_dev->cmd_xfer = NULL;
ec_dev->pkt_xfer = cros_ec_pkt_xfer_ish;
ec_dev->phys_name = dev_name(dev);
- ec_dev->din_size = sizeof(struct cros_ish_in_msg) +
- sizeof(struct ec_response_get_protocol_info);
- ec_dev->dout_size = sizeof(struct cros_ish_out_msg) + sizeof(struct ec_params_rwsig_action);
return cros_ec_register(ec_dev);
}