2014-02-21 12:12:52

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2] regulator: max14577: Fix invalid return value on DT parse success

This fixes bug introduced in 667a6b7a (regulator: max14577: Add missing
of_node_put). The DTS parsing function returned number of matched
regulators as success status which then was compared against 0 in probe.

Result was a probe fail after successful parsing the DTS:
max14577-regulator: probe of max14577-regulator failed with error 2

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Cc: Sachin Kamat <[email protected]>
---
drivers/regulator/max14577.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/max14577.c b/drivers/regulator/max14577.c
index 186df8785a91..e0619526708c 100644
--- a/drivers/regulator/max14577.c
+++ b/drivers/regulator/max14577.c
@@ -166,9 +166,10 @@ static int max14577_regulator_dt_parse_pdata(struct platform_device *pdev)

ret = of_regulator_match(&pdev->dev, np, max14577_regulator_matches,
MAX14577_REG_MAX);
- if (ret < 0) {
+ if (ret < 0)
dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", ret);
- }
+ else
+ ret = 0;

of_node_put(np);

--
1.7.9.5


2014-02-21 13:53:20

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH v2] regulator: max14577: Fix invalid return value on DT parse success

On 21 February 2014 17:42, Krzysztof Kozlowski <[email protected]> wrote:
> This fixes bug introduced in 667a6b7a (regulator: max14577: Add missing
> of_node_put). The DTS parsing function returned number of matched
> regulators as success status which then was compared against 0 in probe.
>
> Result was a probe fail after successful parsing the DTS:
> max14577-regulator: probe of max14577-regulator failed with error 2
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> Cc: Sachin Kamat <[email protected]>

Looks good.
Reviewed-by: Sachin Kamat <[email protected]>


--
With warm regards,
Sachin

2014-02-22 02:54:53

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2] regulator: max14577: Fix invalid return value on DT parse success

On Fri, Feb 21, 2014 at 01:12:38PM +0100, Krzysztof Kozlowski wrote:
> This fixes bug introduced in 667a6b7a (regulator: max14577: Add missing
> of_node_put). The DTS parsing function returned number of matched
> regulators as success status which then was compared against 0 in probe.

Applied, thanks.


Attachments:
(No filename) (304.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments