aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome/cros_ec_rpmsg.c
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@kernel.org>2025-08-28 08:35:57 +0000
committerTzung-Bi Shih <tzungbi@kernel.org>2025-09-14 11:34:41 +0800
commit918856986014142271a70a334d300994b9c41720 (patch)
tree9bd31c49c6fd2be28ed450b75ca7cbb45fb3b2f6 /drivers/platform/chrome/cros_ec_rpmsg.c
parentplatform/chrome: wilco_ec: Remove redundant semicolons (diff)
downloadlinux-918856986014142271a70a334d300994b9c41720.tar.gz
linux-918856986014142271a70a334d300994b9c41720.zip
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>
Diffstat (limited to 'drivers/platform/chrome/cros_ec_rpmsg.c')
-rw-r--r--drivers/platform/chrome/cros_ec_rpmsg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/chrome/cros_ec_rpmsg.c b/drivers/platform/chrome/cros_ec_rpmsg.c
index bc2666491db1..9ac2b923db6d 100644
--- a/drivers/platform/chrome/cros_ec_rpmsg.c
+++ b/drivers/platform/chrome/cros_ec_rpmsg.c
@@ -216,7 +216,7 @@ static int cros_ec_rpmsg_probe(struct rpmsg_device *rpdev)
struct cros_ec_device *ec_dev;
int ret;
- ec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL);
+ ec_dev = cros_ec_device_alloc(dev);
if (!ec_dev)
return -ENOMEM;