summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/wm831x-spi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-10-25 14:47:40 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-01-09 00:37:28 +0100
commitd48cbb74357b42b86ac8edc3bc34bcb3d65a12d9 (patch)
tree382e5c0c68f9beb8cc74235a84dfd861079a92ff /drivers/mfd/wm831x-spi.c
parentLinux 3.2 (diff)
downloadlinux-d48cbb74357b42b86ac8edc3bc34bcb3d65a12d9.tar.xz
linux-d48cbb74357b42b86ac8edc3bc34bcb3d65a12d9.zip
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 '')
-rw-r--r--drivers/mfd/wm831x-spi.c3
1 files changed, 1 insertions, 2 deletions
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)
type = (enum wm831x_parent)id->driver_data;
- wm831x = kzalloc(sizeof(struct wm831x), GFP_KERNEL);
+ wm831x = devm_kzalloc(&spi->dev, sizeof(struct wm831x), GFP_KERNEL);
if (wm831x == NULL)
return -ENOMEM;
@@ -45,7 +45,6 @@ static int __devinit wm831x_spi_probe(struct spi_device *spi)
ret = PTR_ERR(wm831x->regmap);
dev_err(wm831x->dev, "Failed to allocate register map: %d\n",
ret);
- kfree(wm831x);
return ret;
}