Messages in this thread | | | Date | Mon, 14 Jul 2014 12:57:18 +0100 | From | Charles Keepax <> | Subject | Re: [PATCH] regulator: drivers: fix return value of get_mode callback |
| |
On Mon, Jul 14, 2014 at 04:03:17PM +0530, Laxman Dewangan wrote: > The function get_mode() should return 0 on error and REGULATOR_MODE_* > on success. The return type of this function is defined as unsigned int. > > Some of driver who implements this callback return -ve error number when > it fails which is incorrect as per function definitions. Correcting the > implemnetation on different drivers to return 0 (zero) on error and > REGULATOR_MODE_* on success. > > Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> > --- > drivers/regulator/ab8500-ext.c | 4 ++-- > drivers/regulator/ab8500.c | 4 ++-- > drivers/regulator/as3711-regulator.c | 4 ++-- > drivers/regulator/as3722-regulator.c | 4 ++-- > drivers/regulator/da9055-regulator.c | 4 ++-- > drivers/regulator/da9063-regulator.c | 2 +- > drivers/regulator/fan53555.c | 2 +- > drivers/regulator/lp872x.c | 4 ++-- > drivers/regulator/lp8788-buck.c | 2 +- > drivers/regulator/max8649.c | 2 +- > drivers/regulator/max8973-regulator.c | 2 +- > drivers/regulator/mc13892-regulator.c | 2 +- > drivers/regulator/tps62360-regulator.c | 2 +- > drivers/regulator/tps65910-regulator.c | 4 ++-- > drivers/regulator/tps65912-regulator.c | 2 +- > drivers/regulator/wm831x-dcdc.c | 4 ++-- > drivers/regulator/wm831x-ldo.c | 8 ++++---- > drivers/regulator/wm8350-regulator.c | 2 +- > 18 files changed, 29 insertions(+), 29 deletions(-)
Looks like _regulator_get_mode in core.c would need updated too. I can't help but wonder if it might be better to just make get/set mode use an int instead, although I don't know for what reasons an unsigned int was choosen in the first place so I might be missing something.
Thanks, Charles
| |