lkml.org 
[lkml]   [2013]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drivers: mfd: tps65912: Convert to use devm_kzalloc
Date
There is no need to call kfree while using devm_kzalloc,
remove it from *_device_init function.

Signed-off-by: Leon Romanovsky <leon@leon.nu>
---
drivers/mfd/tps65912-core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tps65912-core.c b/drivers/mfd/tps65912-core.c
index aeb8e40..f25e552 100644
--- a/drivers/mfd/tps65912-core.c
+++ b/drivers/mfd/tps65912-core.c
@@ -127,7 +127,8 @@ int tps65912_device_init(struct tps65912 *tps65912)
struct tps65912_platform_data *init_data;
int ret, dcdc_avs, value;

- init_data = kzalloc(sizeof(struct tps65912_platform_data), GFP_KERNEL);
+ init_data = devm_kzalloc(&tps65912->dev,
+ sizeof(struct tps65912_platform_data), GFP_KERNEL);
if (init_data == NULL)
return -ENOMEM;

@@ -156,11 +157,9 @@ int tps65912_device_init(struct tps65912 *tps65912)
if (ret < 0)
goto err;

- kfree(init_data);
return ret;

err:
- kfree(init_data);
mfd_remove_devices(tps65912->dev);
kfree(tps65912);
return ret;
--
1.8.1.5


\
 
 \ /
  Last update: 2013-05-15 12:01    [W:0.088 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site