aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-10-25 08:47:40 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-01-08 18:37:28 -0500
commitd48cbb74357b42b86ac8edc3bc34bcb3d65a12d9 (patch)
tree382e5c0c68f9beb8cc74235a84dfd861079a92ff /drivers/mfd
parent805a6af8dba5dfdd35ec35dc52ec0122400b2610 (diff)
mfd: Convert wm831x core driver to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/wm831x-core.c2
-rw-r--r--drivers/mfd/wm831x-i2c.c3
-rw-r--r--drivers/mfd/wm831x-spi.c3
3 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index 0a2b8d41a702..3b761893f9ba 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -1875,7 +1875,6 @@ err_irq:
1875err_regmap: 1875err_regmap:
1876 mfd_remove_devices(wm831x->dev); 1876 mfd_remove_devices(wm831x->dev);
1877 regmap_exit(wm831x->regmap); 1877 regmap_exit(wm831x->regmap);
1878 kfree(wm831x);
1879 return ret; 1878 return ret;
1880} 1879}
1881 1880
@@ -1887,7 +1886,6 @@ void wm831x_device_exit(struct wm831x *wm831x)
1887 free_irq(wm831x->irq_base + WM831X_IRQ_AUXADC_DATA, wm831x); 1886 free_irq(wm831x->irq_base + WM831X_IRQ_AUXADC_DATA, wm831x);
1888 wm831x_irq_exit(wm831x); 1887 wm831x_irq_exit(wm831x);
1889 regmap_exit(wm831x->regmap); 1888 regmap_exit(wm831x->regmap);
1890 kfree(wm831x);
1891} 1889}
1892 1890
1893int wm831x_device_suspend(struct wm831x *wm831x) 1891int wm831x_device_suspend(struct wm831x *wm831x)
diff --git a/drivers/mfd/wm831x-i2c.c b/drivers/mfd/wm831x-i2c.c
index ac8da1d439da..cb15609b0a48 100644
--- a/drivers/mfd/wm831x-i2c.c
+++ b/drivers/mfd/wm831x-i2c.c
@@ -30,7 +30,7 @@ static int wm831x_i2c_probe(struct i2c_client *i2c,
30 struct wm831x *wm831x; 30 struct wm831x *wm831x;
31 int ret; 31 int ret;
32 32
33 wm831x = kzalloc(sizeof(struct wm831x), GFP_KERNEL); 33 wm831x = devm_kzalloc(&i2c->dev, sizeof(struct wm831x), GFP_KERNEL);
34 if (wm831x == NULL) 34 if (wm831x == NULL)
35 return -ENOMEM; 35 return -ENOMEM;
36 36
@@ -42,7 +42,6 @@ static int wm831x_i2c_probe(struct i2c_client *i2c,
42 ret = PTR_ERR(wm831x->regmap); 42 ret = PTR_ERR(wm831x->regmap);
43 dev_err(wm831x->dev, "Failed to allocate register map: %d\n", 43 dev_err(wm831x->dev, "Failed to allocate register map: %d\n",
44 ret); 44 ret);
45 kfree(wm831x);
46 return ret; 45 return ret;
47 } 46 }
48 47
diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c
index 8d6a9a969dbc..a43cba373001 100644
--- a/drivers/mfd/wm831x-spi.c
+++ b/drivers/mfd/wm831x-spi.c
@@ -30,7 +30,7 @@ static int __devinit wm831x_spi_probe(struct spi_device *spi)
30 30
31 type = (enum wm831x_parent)id->driver_data; 31 type = (enum wm831x_parent)id->driver_data;
32 32
33 wm831x = kzalloc(sizeof(struct wm831x), GFP_KERNEL); 33 wm831x = devm_kzalloc(&spi->dev, sizeof(struct wm831x), GFP_KERNEL);
34 if (wm831x == NULL) 34 if (wm831x == NULL)
35 return -ENOMEM; 35 return -ENOMEM;
36 36
@@ -45,7 +45,6 @@ static int __devinit wm831x_spi_probe(struct spi_device *spi)
45 ret = PTR_ERR(wm831x->regmap); 45 ret = PTR_ERR(wm831x->regmap);
46 dev_err(wm831x->dev, "Failed to allocate register map: %d\n", 46 dev_err(wm831x->dev, "Failed to allocate register map: %d\n",
47 ret); 47 ret);
48 kfree(wm831x);
49 return ret; 48 return ret;
50 } 49 }
51 50