diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-07 21:55:22 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-01-08 18:37:32 -0500 |
commit | 55ee29d5fff18b6485543bea10620daf9e29555c (patch) | |
tree | d83ace63ab7bb4281b89aba20fb5837fa1bbe085 /drivers/mfd/wm8350-i2c.c | |
parent | 18bf50a374a46aec83652f48006a6fac764c635d (diff) |
mfd: Convert WM8350 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/wm8350-i2c.c')
-rw-r--r-- | drivers/mfd/wm8350-i2c.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c index 5fe5de166adb..d955faaf27c4 100644 --- a/drivers/mfd/wm8350-i2c.c +++ b/drivers/mfd/wm8350-i2c.c | |||
@@ -63,7 +63,7 @@ static int wm8350_i2c_probe(struct i2c_client *i2c, | |||
63 | struct wm8350 *wm8350; | 63 | struct wm8350 *wm8350; |
64 | int ret = 0; | 64 | int ret = 0; |
65 | 65 | ||
66 | wm8350 = kzalloc(sizeof(struct wm8350), GFP_KERNEL); | 66 | wm8350 = devm_kzalloc(&i2c->dev, sizeof(struct wm8350), GFP_KERNEL); |
67 | if (wm8350 == NULL) | 67 | if (wm8350 == NULL) |
68 | return -ENOMEM; | 68 | return -ENOMEM; |
69 | 69 | ||
@@ -80,7 +80,6 @@ static int wm8350_i2c_probe(struct i2c_client *i2c, | |||
80 | return ret; | 80 | return ret; |
81 | 81 | ||
82 | err: | 82 | err: |
83 | kfree(wm8350); | ||
84 | return ret; | 83 | return ret; |
85 | } | 84 | } |
86 | 85 | ||
@@ -89,7 +88,6 @@ static int wm8350_i2c_remove(struct i2c_client *i2c) | |||
89 | struct wm8350 *wm8350 = i2c_get_clientdata(i2c); | 88 | struct wm8350 *wm8350 = i2c_get_clientdata(i2c); |
90 | 89 | ||
91 | wm8350_device_exit(wm8350); | 90 | wm8350_device_exit(wm8350); |
92 | kfree(wm8350); | ||
93 | 91 | ||
94 | return 0; | 92 | return 0; |
95 | } | 93 | } |