linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: tps65217: Fix using wrong dev argument for calling of_regulator_match
@ 2013-01-24  2:27 Axel Lin
  2013-01-24  2:31 ` [PATCH 2/2] regulator: tps65910: " Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Axel Lin @ 2013-01-24  2:27 UTC (permalink / raw)
  To: Mark Brown; +Cc: AnilKumar Ch, Liam Girdwood, linux-kernel

The dev parameter is the device requestiong the data.
In this case it should be &pdev->dev rather than pdev->dev.parent.

The dev parameter is used to call devm_kzalloc in of_get_regulator_init_data(),
which means this fixes a memory leak because the memory is allocated every time
probe() is called, thus it should be freed when this driver is unloaded.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/tps65217-regulator.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c
index 73dce76..df39518 100644
--- a/drivers/regulator/tps65217-regulator.c
+++ b/drivers/regulator/tps65217-regulator.c
@@ -305,8 +305,8 @@ static struct tps65217_board *tps65217_parse_dt(struct platform_device *pdev)
 	if (!regs)
 		return NULL;
 
-	count = of_regulator_match(pdev->dev.parent, regs,
-				reg_matches, TPS65217_NUM_REGULATOR);
+	count = of_regulator_match(&pdev->dev, regs, reg_matches,
+				   TPS65217_NUM_REGULATOR);
 	of_node_put(regs);
 	if ((count < 0) || (count > TPS65217_NUM_REGULATOR))
 		return NULL;
-- 
1.7.9.5




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

end of thread, other threads:[~2013-01-29 18:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-24  2:27 [PATCH 1/2] regulator: tps65217: Fix using wrong dev argument for calling of_regulator_match Axel Lin
2013-01-24  2:31 ` [PATCH 2/2] regulator: tps65910: " Axel Lin
2013-01-24  4:45   ` Laxman Dewangan
2013-01-24 17:02     ` gg
2013-01-29  0:03   ` Stephen Warren
2013-01-29  3:39     ` Mark Brown
2013-01-29 18:46       ` Stephen Warren
2013-01-24  4:52 ` [PATCH 1/2] regulator: tps65217: " Mark Brown
     [not found]   ` <CAFRkauDdbYH2jm_TXypjhe0rWyEOpS-JqZ1G4-WZmFKFJngbkw@mail.gmail.com>
2013-01-24 10:00     ` Mark Brown
2013-01-24 11:00 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).