diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-25 08:47:40 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-01-08 18:37:28 -0500 |
commit | d48cbb74357b42b86ac8edc3bc34bcb3d65a12d9 (patch) | |
tree | 382e5c0c68f9beb8cc74235a84dfd861079a92ff /drivers/mfd/wm831x-spi.c | |
parent | 805a6af8dba5dfdd35ec35dc52ec0122400b2610 (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/wm831x-spi.c')
-rw-r--r-- | drivers/mfd/wm831x-spi.c | 3 |
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) | |||
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 | ||