]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regulator: da9063: Fix PTR_ERR/ERR_PTR mismatch
authorGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 9 Sep 2013 11:49:26 +0000 (13:49 +0200)
committerMark Brown <broonie@linaro.org>
Tue, 10 Sep 2013 17:11:41 +0000 (18:11 +0100)
If CONFIG_OF=n:

drivers/regulator/da9063-regulator.c: In function ‘da9063_parse_regulators_dt’:
drivers/regulator/da9063-regulator.c:712: warning: passing argument 1 of ‘PTR_ERR’ makes pointer from integer without a cast
drivers/regulator/da9063-regulator.c:712: warning: return makes pointer from integer without a cast

Use ERR_PTR() to encode an error code in a pointer.
PTR_ERR() is meant to decode an error code from a pointer.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/da9063-regulator.c

index 1a78163907734be9e1e49bd3bca6e2fc19e7b6c7..b9f2653e4ef90f315de25752fe24821a98497848 100644 (file)
@@ -709,7 +709,7 @@ static struct da9063_regulators_pdata *da9063_parse_regulators_dt(
                struct of_regulator_match **da9063_reg_matches)
 {
        da9063_reg_matches = NULL;
-       return PTR_ERR(-ENODEV);
+       return ERR_PTR(-ENODEV);
 }
 #endif