diff mbox

regulator: act8865: fix incorrect devm_kzalloc for act8865

Message ID 1388040763-15653-1-git-send-email-wenyou.yang@atmel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wenyou Yang Dec. 26, 2013, 6:52 a.m. UTC
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(-)

Comments

Mark Brown Dec. 30, 2013, 12:07 p.m. UTC | #1
On Thu, Dec 26, 2013 at 02:52:43PM +0800, Wenyou Yang wrote:
> Which cause to allocate more needless memory.

Applied, thanks.
diff mbox

Patch

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;