aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-05 12:45:34 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-05 12:45:34 -0500
commit5e0dc1a7ce1f322c06e993845def2c73cfc485fd (patch)
treef3948da9520d33dd10d5a1521ba2b9f819d50cc8
parenta517af52cb57f972cee2378765e1c5dd10141f0d (diff)
parent48a2ca0ee3994df53da230c7079a18a70ec914f9 (diff)
Merge tag 'mfd-fixes-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull mfd bugfix from Lee Jones: "Replace release function in cros_ec_dev" * tag 'mfd-fixes-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: Revert "mfd: cros_ec: Use devm_kzalloc for private data"
-rw-r--r--drivers/mfd/cros_ec_dev.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index 8f9d6964173e..b99a194ce5a4 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -263,6 +263,11 @@ static const struct file_operations fops = {
263#endif 263#endif
264}; 264};
265 265
266static void cros_ec_class_release(struct device *dev)
267{
268 kfree(to_cros_ec_dev(dev));
269}
270
266static void cros_ec_sensors_register(struct cros_ec_dev *ec) 271static void cros_ec_sensors_register(struct cros_ec_dev *ec)
267{ 272{
268 /* 273 /*
@@ -395,7 +400,7 @@ static int ec_device_probe(struct platform_device *pdev)
395 int retval = -ENOMEM; 400 int retval = -ENOMEM;
396 struct device *dev = &pdev->dev; 401 struct device *dev = &pdev->dev;
397 struct cros_ec_platform *ec_platform = dev_get_platdata(dev); 402 struct cros_ec_platform *ec_platform = dev_get_platdata(dev);
398 struct cros_ec_dev *ec = devm_kzalloc(dev, sizeof(*ec), GFP_KERNEL); 403 struct cros_ec_dev *ec = kzalloc(sizeof(*ec), GFP_KERNEL);
399 404
400 if (!ec) 405 if (!ec)
401 return retval; 406 return retval;
@@ -417,6 +422,7 @@ static int ec_device_probe(struct platform_device *pdev)
417 ec->class_dev.devt = MKDEV(ec_major, pdev->id); 422 ec->class_dev.devt = MKDEV(ec_major, pdev->id);
418 ec->class_dev.class = &cros_class; 423 ec->class_dev.class = &cros_class;
419 ec->class_dev.parent = dev; 424 ec->class_dev.parent = dev;
425 ec->class_dev.release = cros_ec_class_release;
420 426
421 retval = dev_set_name(&ec->class_dev, "%s", ec_platform->ec_name); 427 retval = dev_set_name(&ec->class_dev, "%s", ec_platform->ec_name);
422 if (retval) { 428 if (retval) {