summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/cros_ec_dev.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2018-05-30 18:54:22 +0200
committerLee Jones <lee.jones@linaro.org>2018-06-04 09:46:42 +0200
commit3aa2177e47878f7e7616da8a2050c44f22301b6e (patch)
treecfb9d39a9454516fd376b263629ad46b2164e0c6 /drivers/mfd/cros_ec_dev.c
parentmfd: intel-lpss: Fix Intel Cannon Lake LPSS I2C input clock (diff)
downloadlinux-3aa2177e47878f7e7616da8a2050c44f22301b6e.tar.xz
linux-3aa2177e47878f7e7616da8a2050c44f22301b6e.zip
mfd: cros_ec: Use devm_kzalloc for private data
Use dev_kzmalloc, remove .release entry point. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/cros_ec_dev.c')
-rw-r--r--drivers/mfd/cros_ec_dev.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index 1d6dc5c7a19d..81466264f7fc 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -262,12 +262,7 @@ static const struct file_operations fops = {
#endif
};
-static void __remove(struct device *dev)
-{
- struct cros_ec_dev *ec = container_of(dev, struct cros_ec_dev,
- class_dev);
- kfree(ec);
-}
+static void __remove(struct device *dev) { }
static void cros_ec_sensors_register(struct cros_ec_dev *ec)
{
@@ -392,7 +387,7 @@ static int ec_device_probe(struct platform_device *pdev)
int retval = -ENOMEM;
struct device *dev = &pdev->dev;
struct cros_ec_platform *ec_platform = dev_get_platdata(dev);
- struct cros_ec_dev *ec = kzalloc(sizeof(*ec), GFP_KERNEL);
+ struct cros_ec_dev *ec = devm_kzalloc(dev, sizeof(*ec), GFP_KERNEL);
if (!ec)
return retval;
@@ -414,7 +409,6 @@ static int ec_device_probe(struct platform_device *pdev)
ec->class_dev.devt = MKDEV(ec_major, pdev->id);
ec->class_dev.class = &cros_class;
ec->class_dev.parent = dev;
- ec->class_dev.release = __remove;
retval = dev_set_name(&ec->class_dev, "%s", ec_platform->ec_name);
if (retval) {