lkml.org 
[lkml]   [2013]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] regulator: act8865: fix incorrect devm_kzalloc for act8865
Date
Which cause to allocate more needless memory.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/regulator/act8865-regulator.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index f853353..aecf01b 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -290,9 +290,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
return -EINVAL;
}

- act8865 = devm_kzalloc(dev, sizeof(struct act8865) +
- sizeof(struct regulator_dev *) * ACT8865_REG_NUM,
- GFP_KERNEL);
+ act8865 = devm_kzalloc(dev, sizeof(struct act8865), GFP_KERNEL);
if (!act8865)
return -ENOMEM;

--
1.7.9.5


\
 
 \ /
  Last update: 2013-12-26 08:21    [W:0.033 / U:1.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site