diff mbox

[U-Boot,30/55] dm: pmic: Display the regulator limits on error

Message ID 1435882592-487-31-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 3, 2015, 12:16 a.m. UTC
When a regulator command cannot honour the requested voltage, display the
limits to try to be helpful.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/cmd_regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Przemyslaw Marczak July 10, 2015, 11:54 a.m. UTC | #1
Hello Simon,

On 07/03/2015 02:16 AM, Simon Glass wrote:
> When a regulator command cannot honour the requested voltage, display the
> limits to try to be helpful.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>   common/cmd_regulator.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/common/cmd_regulator.c b/common/cmd_regulator.c
> index 6149d1e..2d8579b 100644
> --- a/common/cmd_regulator.c
> +++ b/common/cmd_regulator.c
> @@ -241,7 +241,8 @@ static int do_value(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>
>   	value = simple_strtoul(argv[1], NULL, 0);
>   	if ((value < uc_pdata->min_uV || value > uc_pdata->max_uV) && !force) {
> -		printf("Value exceeds regulator constraint limits\n");

Could you please also add printing the 'uV' unit?

> +		printf("Value exceeds regulator constraint limits %d..%d\n",
> +		       uc_pdata->min_uV, uc_pdata->max_uV);
>   		return CMD_RET_FAILURE;
>   	}
>
>

Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

Regards
Simon Glass July 27, 2015, 11:30 p.m. UTC | #2
On 10 July 2015 at 05:54, Przemyslaw Marczak <p.marczak@samsung.com> wrote:
> Hello Simon,
>
> On 07/03/2015 02:16 AM, Simon Glass wrote:
>>
>> When a regulator command cannot honour the requested voltage, display the
>> limits to try to be helpful.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>>   common/cmd_regulator.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/common/cmd_regulator.c b/common/cmd_regulator.c
>> index 6149d1e..2d8579b 100644
>> --- a/common/cmd_regulator.c
>> +++ b/common/cmd_regulator.c
>> @@ -241,7 +241,8 @@ static int do_value(cmd_tbl_t *cmdtp, int flag, int
>> argc, char * const argv[])
>>
>>         value = simple_strtoul(argv[1], NULL, 0);
>>         if ((value < uc_pdata->min_uV || value > uc_pdata->max_uV) &&
>> !force) {
>> -               printf("Value exceeds regulator constraint limits\n");
>
>
> Could you please also add printing the 'uV' unit?

I added uV to the end.

>
>> +               printf("Value exceeds regulator constraint limits
>> %d..%d\n",
>> +                      uc_pdata->min_uV, uc_pdata->max_uV);
>>                 return CMD_RET_FAILURE;
>>         }
>>
>>
>
> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
>
> Regards
> --
> Przemyslaw Marczak
> Samsung R&D Institute Poland
> Samsung Electronics
> p.marczak@samsung.com

Applied to u-boot-dm.
diff mbox

Patch

diff --git a/common/cmd_regulator.c b/common/cmd_regulator.c
index 6149d1e..2d8579b 100644
--- a/common/cmd_regulator.c
+++ b/common/cmd_regulator.c
@@ -241,7 +241,8 @@  static int do_value(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	value = simple_strtoul(argv[1], NULL, 0);
 	if ((value < uc_pdata->min_uV || value > uc_pdata->max_uV) && !force) {
-		printf("Value exceeds regulator constraint limits\n");
+		printf("Value exceeds regulator constraint limits %d..%d\n",
+		       uc_pdata->min_uV, uc_pdata->max_uV);
 		return CMD_RET_FAILURE;
 	}