Commit e8cb204c authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Mark Brown

regulator: da9063: Fix PTR_ERR/ERR_PTR mismatch

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent a5848622
...@@ -709,7 +709,7 @@ static struct da9063_regulators_pdata *da9063_parse_regulators_dt( ...@@ -709,7 +709,7 @@ static struct da9063_regulators_pdata *da9063_parse_regulators_dt(
struct of_regulator_match **da9063_reg_matches) struct of_regulator_match **da9063_reg_matches)
{ {
da9063_reg_matches = NULL; da9063_reg_matches = NULL;
return PTR_ERR(-ENODEV); return ERR_PTR(-ENODEV);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment