From: Krzysztof Kozlowski Date: Mon, 10 Mar 2014 09:46:52 +0000 (+0100) Subject: regulator: max1586: Don't allocate memory for regulator_dev pointers X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2d45e78a9a89b099685fbe9708723f3393c10a79;p=linux-beck.git regulator: max1586: Don't allocate memory for regulator_dev pointers Do not allocate memory for 'struct regulator_dev *' since it was removed from state container (values returned by devm_regulator_register() are not used outside of probe). Signed-off-by: Krzysztof Kozlowski Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index c2a40a1a9e3e..d23d0577754b 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c @@ -165,8 +165,7 @@ static int max1586_pmic_probe(struct i2c_client *client, struct max1586_data *max1586; int i, id; - max1586 = devm_kzalloc(&client->dev, sizeof(struct max1586_data) + - sizeof(struct regulator_dev *) * (MAX1586_V6 + 1), + max1586 = devm_kzalloc(&client->dev, sizeof(struct max1586_data), GFP_KERNEL); if (!max1586) return -ENOMEM;