mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: max1586: Don't allocate memory for regulator_dev pointers
@ 2014-03-10  9:46 Krzysztof Kozlowski
  2014-03-10 10:24 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2014-03-10  9:46 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, linux-kernel; +Cc: Krzysztof Kozlowski

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 <k.kozlowski@samsung.com>
---
 drivers/regulator/max1586.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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;
-- 
1.7.9.5


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

* Re: [PATCH] regulator: max1586: Don't allocate memory for regulator_dev pointers
  2014-03-10  9:46 [PATCH] regulator: max1586: Don't allocate memory for regulator_dev pointers Krzysztof Kozlowski
@ 2014-03-10 10:24 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-03-10 10:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

On Mon, Mar 10, 2014 at 10:46:52AM +0100, Krzysztof Kozlowski wrote:
> 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).

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-03-10 10:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-10  9:46 [PATCH] regulator: max1586: Don't allocate memory for regulator_dev pointers Krzysztof Kozlowski
2014-03-10 10:24 ` Mark Brown

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

all inboxes | Powered by JetHome®