* [PATCH] regulator: max8952: Use devm_kzalloc
@ 2012-05-16 4:50 Axel Lin
2012-05-16 8:48 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2012-05-16 4:50 UTC (permalink / raw)
To: linux-kernel; +Cc: Mark Brown, Kyungmin Park, Liam Girdwood, MyungJoo Ham
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/max8952.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c
index 62ae140..910c9b2 100644
--- a/drivers/regulator/max8952.c
+++ b/drivers/regulator/max8952.c
@@ -181,7 +181,8 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
return -EIO;
- max8952 = kzalloc(sizeof(struct max8952_data), GFP_KERNEL);
+ max8952 = devm_kzalloc(&client->dev, sizeof(struct max8952_data),
+ GFP_KERNEL);
if (!max8952)
return -ENOMEM;
@@ -198,7 +199,7 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
if (IS_ERR(max8952->rdev)) {
ret = PTR_ERR(max8952->rdev);
dev_err(max8952->dev, "regulator init failed (%d)\n", ret);
- goto err_reg;
+ return ret;
}
max8952->en = !!(pdata->reg_data.constraints.boot_on);
@@ -295,10 +296,6 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
i2c_set_clientdata(client, max8952);
return 0;
-
-err_reg:
- kfree(max8952);
- return ret;
}
static int __devexit max8952_pmic_remove(struct i2c_client *client)
@@ -312,8 +309,6 @@ static int __devexit max8952_pmic_remove(struct i2c_client *client)
gpio_free(pdata->gpio_vid0);
gpio_free(pdata->gpio_vid1);
gpio_free(pdata->gpio_en);
-
- kfree(max8952);
return 0;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] regulator: max8952: Use devm_kzalloc
2012-05-16 4:50 [PATCH] regulator: max8952: Use devm_kzalloc Axel Lin
@ 2012-05-16 8:48 ` Mark Brown
0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-05-16 8:48 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Kyungmin Park, Liam Girdwood, MyungJoo Ham
[-- Attachment #1: Type: text/plain, Size: 123 bytes --]
On Wed, May 16, 2012 at 12:50:47PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] regulator: max8952: Use devm_kzalloc
@ 2012-05-16 4:56 MyungJoo Ham
0 siblings, 0 replies; 3+ messages in thread
From: MyungJoo Ham @ 2012-05-16 4:56 UTC (permalink / raw)
To: Axel Lin, linux-kernel
Cc: Mark Brown, 박경민, Liam Girdwood
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 369 bytes --]
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> ---
> drivers/regulator/max8952.c | 11 +++--------
> 1 files changed, 3 insertions(+), 8 deletions(-)
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-16 8:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-16 4:50 [PATCH] regulator: max8952: Use devm_kzalloc Axel Lin
2012-05-16 8:48 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2012-05-16 4:56 MyungJoo Ham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox