* [PATCH] regulator: tps6586x: (cosmetic) simplify a conditional
@ 2013-02-25 11:34 Guennadi Liakhovetski
2013-03-01 6:58 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2013-02-25 11:34 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel
of_node_put() is called on either branch of a conditional, simplify the
code by only calling it once.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
drivers/regulator/tps6586x-regulator.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index f86da67..1471ead 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -338,14 +338,12 @@ static struct tps6586x_platform_data *tps6586x_parse_regulator_dt(
}
err = of_regulator_match(&pdev->dev, regs, tps6586x_matches, num);
+ of_node_put(regs);
if (err < 0) {
dev_err(&pdev->dev, "Regulator match failed, e %d\n", err);
- of_node_put(regs);
return NULL;
}
- of_node_put(regs);
-
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
dev_err(&pdev->dev, "Memory alloction failed\n");
--
1.7.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: tps6586x: (cosmetic) simplify a conditional
2013-02-25 11:34 [PATCH] regulator: tps6586x: (cosmetic) simplify a conditional Guennadi Liakhovetski
@ 2013-03-01 6:58 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-03-01 6:58 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
On Mon, Feb 25, 2013 at 12:34:09PM +0100, Guennadi Liakhovetski wrote:
> of_node_put() is called on either branch of a conditional, simplify the
> code by only calling it once.
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:[~2013-03-01 6:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-25 11:34 [PATCH] regulator: tps6586x: (cosmetic) simplify a conditional Guennadi Liakhovetski
2013-03-01 6:58 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox