From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: broonie@kernel.org, milo.kim@ti.com,
support.opensource@diasemi.com,
patches@opensource.wolfsonmicro.com, lgirdwood@gmail.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: drivers: fix return value of get_mode callback
Date: Mon, 14 Jul 2014 12:57:18 +0100 [thread overview]
Message-ID: <20140714115718.GA18724@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1405333997-28764-1-git-send-email-ldewangan@nvidia.com>
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
next prev parent reply other threads:[~2014-07-14 11:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 10:33 [PATCH] regulator: drivers: fix return value of get_mode callback Laxman Dewangan
2014-07-14 11:57 ` Charles Keepax [this message]
2014-07-14 18:01 ` Mark Brown
2014-07-24 9:45 ` Laxman Dewangan
2014-07-25 17:51 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140714115718.GA18724@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=broonie@kernel.org \
--cc=ldewangan@nvidia.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=milo.kim@ti.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=support.opensource@diasemi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.