Skip to content

Commit

Permalink
regulator: da9063: Fix PTR_ERR/ERR_PTR mismatch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geert Uytterhoeven authored and Mark Brown committed Sep 10, 2013
1 parent a584862 commit e8cb204
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/da9063-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e8cb204

Please sign in to comment.