dm: pmic: Display the regulator limits on error
authorSimon Glass <sjg@chromium.org>
Fri, 3 Jul 2015 00:16:07 +0000 (18:16 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 6 Aug 2015 03:06:13 +0000 (21:06 -0600)
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>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
common/cmd_regulator.c

index 6149d1ee440ef4c19c12471062ad63394981e124..793f08e81a92fef5c996b9518c7f00f7ed81c6e3 100644 (file)
@@ -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 uV\n",
+                      uc_pdata->min_uV, uc_pdata->max_uV);
                return CMD_RET_FAILURE;
        }