Commit 5e0dc1a7 authored by Linus Torvalds's avatar Linus Torvalds

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"
parents a517af52 48a2ca0e
...@@ -263,6 +263,11 @@ static const struct file_operations fops = { ...@@ -263,6 +263,11 @@ static const struct file_operations fops = {
#endif #endif
}; };
static void cros_ec_class_release(struct device *dev)
{
kfree(to_cros_ec_dev(dev));
}
static void cros_ec_sensors_register(struct cros_ec_dev *ec) static void cros_ec_sensors_register(struct cros_ec_dev *ec)
{ {
/* /*
...@@ -395,7 +400,7 @@ static int ec_device_probe(struct platform_device *pdev) ...@@ -395,7 +400,7 @@ static int ec_device_probe(struct platform_device *pdev)
int retval = -ENOMEM; int retval = -ENOMEM;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct cros_ec_platform *ec_platform = dev_get_platdata(dev); struct cros_ec_platform *ec_platform = dev_get_platdata(dev);
struct cros_ec_dev *ec = devm_kzalloc(dev, sizeof(*ec), GFP_KERNEL); struct cros_ec_dev *ec = kzalloc(sizeof(*ec), GFP_KERNEL);
if (!ec) if (!ec)
return retval; return retval;
...@@ -417,6 +422,7 @@ static int ec_device_probe(struct platform_device *pdev) ...@@ -417,6 +422,7 @@ static int ec_device_probe(struct platform_device *pdev)
ec->class_dev.devt = MKDEV(ec_major, pdev->id); ec->class_dev.devt = MKDEV(ec_major, pdev->id);
ec->class_dev.class = &cros_class; ec->class_dev.class = &cros_class;
ec->class_dev.parent = dev; ec->class_dev.parent = dev;
ec->class_dev.release = cros_ec_class_release;
retval = dev_set_name(&ec->class_dev, "%s", ec_platform->ec_name); retval = dev_set_name(&ec->class_dev, "%s", ec_platform->ec_name);
if (retval) { if (retval) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment