linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: Convert s5m core driver to use devm_kzalloc()
@ 2012-01-20  7:09 Sangbeom Kim
  2012-01-20  7:09 ` [PATCH 2/2] mfd: Add support for multiple s5m devices Sangbeom Kim
  2012-02-20 16:52 ` [PATCH 1/2] mfd: Convert s5m core driver to use devm_kzalloc() Samuel Ortiz
  0 siblings, 2 replies; 5+ messages in thread
From: Sangbeom Kim @ 2012-01-20  7:09 UTC (permalink / raw)
  To: sameo, linux-kernel; +Cc: broonie, Sangbeom Kim

Convert s5m core driver to use devm_kzalloc().

Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
---
 drivers/mfd/s5m-core.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/s5m-core.c b/drivers/mfd/s5m-core.c
index e075c11..38bd353 100644
--- a/drivers/mfd/s5m-core.c
+++ b/drivers/mfd/s5m-core.c
@@ -77,7 +77,8 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c,
 	int ret = 0;
 	int error;
 
-	s5m87xx = kzalloc(sizeof(struct s5m87xx_dev), GFP_KERNEL);
+	s5m87xx = devm_kzalloc(&i2c->dev, sizeof(struct s5m87xx_dev),
+				GFP_KERNEL);
 	if (s5m87xx == NULL)
 		return -ENOMEM;
 
@@ -126,7 +127,6 @@ err:
 	s5m_irq_exit(s5m87xx);
 	i2c_unregister_device(s5m87xx->rtc);
 	regmap_exit(s5m87xx->regmap);
-	kfree(s5m87xx);
 	return ret;
 }
 
@@ -138,7 +138,6 @@ static int s5m87xx_i2c_remove(struct i2c_client *i2c)
 	s5m_irq_exit(s5m87xx);
 	i2c_unregister_device(s5m87xx->rtc);
 	regmap_exit(s5m87xx->regmap);
-	kfree(s5m87xx);
 	return 0;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-20 16:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-20  7:09 [PATCH 1/2] mfd: Convert s5m core driver to use devm_kzalloc() Sangbeom Kim
2012-01-20  7:09 ` [PATCH 2/2] mfd: Add support for multiple s5m devices Sangbeom Kim
2012-01-20 18:23   ` Mark Brown
2012-02-20 16:54   ` Samuel Ortiz
2012-02-20 16:52 ` [PATCH 1/2] mfd: Convert s5m core driver to use devm_kzalloc() Samuel Ortiz

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).