[U-Boot] [PATCH 08/19] dm: regulator: add max77686 regulator driver

Tom Rini
2014-10-22T15:32:11Z

On Wed, Oct 08, 2014 at 10:48:44PM +0200, Przemyslaw Marczak wrote:

> This commit adds support to max77686 regulator driver
> based on a uclass regulator driver-model api, which
> provides implementation of all uclass regulator api
> function calls.
>
> New file: drivers/power/regulator/max77686.c
> New config: CONFIG_DM_REGULATOR_MAX77686
>
> Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
[snip]
> + if (ldo < 1 || ldo > 26) {
> + debug("%s: %d is wrong ldo number\n", __func__, ldo);
> + return -EINVAL;
> + }
[snip]
> + if (buck < 1 || buck > 9) {
> + debug("%s: %d is wrong buck number\n", __func__, buck);
> + return -EINVAL;
> + }
[snip]
> + if (ldo < 1 || ldo > 26) {
> + debug("%s: %d is wrong ldo number\n", __func__, ldo);
> + return -EINVAL;
> + }
[snip]
> + if (mode == 0xff) {
> + debug("%s: %d is not supported on LDO%d\n", __func__, *opmode,
> + ldo);
> + return -EINVAL;
> + }
[snip]
> + if (buck < 1 || buck > 9) {
> + debug("%s: %d is wrong buck number\n", __func__, buck);
> + return -EINVAL;
> + }
[snip]
> + if (mode == 0xff) {
> + debug("%s: %d is not supported on BUCK%d\n", __func__, *opmode,
> + buck);
> + return -EINVAL;
> + }

In my mind, all of these error messages are things the user would want
to see because they passed the wrong value in, higher up in the chain,
as these are eventually exposed at the cli, right? If so, they should
be error() prints or otherwise changed around so it's clear to the user
what they did wrong.

--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141022/05169e9e/attachment.pgp>