linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@leon.nu>
To: sameo@linux.intel.com
Cc: linux-kernel@vger.kernel.org, Leon Romanovsky <leon@leon.nu>
Subject: [PATCH] drivers: mfd: tps65912: Convert to use devm_kzalloc
Date: Wed, 15 May 2013 12:19:46 +0300	[thread overview]
Message-ID: <1368609586-20905-1-git-send-email-leon@leon.nu> (raw)

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


             reply	other threads:[~2013-05-15  9:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-15  9:19 Leon Romanovsky [this message]
2013-05-17 18:07 ` [PATCH] drivers: mfd: tps65912: Convert to use devm_kzalloc Leon Romanovsky
2013-05-23  8:23   ` Lee Jones
2013-05-23  7:35 ` Lee Jones
2013-05-23  8:37 ` Lee Jones
     [not found]   ` <CALq1K=Las2mwV9x6ajEUDYg6nLbcK2KVLK8TH2B1f=9fQ7JfTg@mail.gmail.com>
2013-05-28  9:02     ` Lee Jones
2013-05-28 16:24       ` Andy Shevchenko
2013-05-28 18:36         ` Leon Romanovsky
2013-05-28 19:16           ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368609586-20905-1-git-send-email-leon@leon.nu \
    --to=leon@leon.nu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).