public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] regulator: anatop-regulator: Only jump to 'anatop_probe_end' on error
@ 2013-12-21 19:27 Fabio Estevam
  2013-12-21 19:27 ` [PATCH v2 2/2] regulator: anatop-regulator: Remove unneeded variable Fabio Estevam
  2013-12-23  8:24 ` [PATCH v2 1/2] regulator: anatop-regulator: Only jump to 'anatop_probe_end' on error Shawn Guo
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2013-12-21 19:27 UTC (permalink / raw)
  To: broonie; +Cc: shawn.guo, Anson.Huang, linux-kernel, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Currently 'anatop_probe_end' path is executed on both succesfull and error paths
of anatop_regulator_probe().

To let the code a bit clearer, make 'anatop_probe_end' to be executed only when
an error happens.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/regulator/anatop-regulator.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index c734d09..53e6048 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -210,9 +210,10 @@ static int anatop_regulator_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, rdev);
 
+	return 0;
+
 anatop_probe_end:
-	if (ret)
-		kfree(sreg->name);
+	kfree(sreg->name);
 
 	return ret;
 }
-- 
1.8.1.2


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

end of thread, other threads:[~2013-12-23  8:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-21 19:27 [PATCH v2 1/2] regulator: anatop-regulator: Only jump to 'anatop_probe_end' on error Fabio Estevam
2013-12-21 19:27 ` [PATCH v2 2/2] regulator: anatop-regulator: Remove unneeded variable Fabio Estevam
2013-12-23  8:24 ` [PATCH v2 1/2] regulator: anatop-regulator: Only jump to 'anatop_probe_end' on error Shawn Guo

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