public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] regulator: isl6271a-regulator: Use devm_kzalloc()
@ 2012-04-11 15:05 Axel Lin
  2012-04-11 15:06 ` [PATCH 2/3] regulator: max1586: " Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Axel Lin @ 2012-04-11 15:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Marek Vasut, Liam Girdwood, Mark Brown

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/isl6271a-regulator.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/isl6271a-regulator.c b/drivers/regulator/isl6271a-regulator.c
index 863f45a..60044c3 100644
--- a/drivers/regulator/isl6271a-regulator.c
+++ b/drivers/regulator/isl6271a-regulator.c
@@ -148,7 +148,7 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c,
 	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
 		return -EIO;
 
-	pmic = kzalloc(sizeof(struct isl_pmic), GFP_KERNEL);
+	pmic = devm_kzalloc(&i2c->dev, sizeof(struct isl_pmic), GFP_KERNEL);
 	if (!pmic)
 		return -ENOMEM;
 
@@ -179,8 +179,6 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c,
 error:
 	while (--i >= 0)
 		regulator_unregister(pmic->rdev[i]);
-
-	kfree(pmic);
 	return err;
 }
 
@@ -191,9 +189,6 @@ static int __devexit isl6271a_remove(struct i2c_client *i2c)
 
 	for (i = 0; i < 3; i++)
 		regulator_unregister(pmic->rdev[i]);
-
-	kfree(pmic);
-
 	return 0;
 }
 
-- 
1.7.5.4




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

end of thread, other threads:[~2012-04-13  8:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-11 15:05 [PATCH 1/3] regulator: isl6271a-regulator: Use devm_kzalloc() Axel Lin
2012-04-11 15:06 ` [PATCH 2/3] regulator: max1586: " Axel Lin
2012-04-11 15:08 ` [PATCH 3/3] regulator: max8660: " Axel Lin
2012-04-13  8:59 ` [PATCH 1/3] regulator: isl6271a-regulator: " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox