imx: add imx8x capricorn giedi board
[oweals/u-boot.git] / cmd / regulator.c
index bfea6e04b6746dbb5d8efaa26073761ad9d390f9..ed8d778c8243b3186e4d6578e9955de632c17975 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2014-2015 Samsung Electronics
  * Przemyslaw Marczak <p.marczak@samsung.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <errno.h>
@@ -71,7 +70,7 @@ static int curr_dev_and_platdata(struct udevice **devp,
 
        *uc_pdata = dev_get_uclass_platdata(*devp);
        if (!*uc_pdata) {
-               error("Regulator: %s - missing platform data!", currdev->name);
+               pr_err("Regulator: %s - missing platform data!\n", currdev->name);
                return CMD_RET_FAILURE;
        }
 
@@ -292,7 +291,10 @@ static int do_value(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                return CMD_RET_FAILURE;
        }
 
-       ret = regulator_set_value(dev, value);
+       if (!force)
+               ret = regulator_set_value(dev, value);
+       else
+               ret = regulator_set_value_force(dev, value);
        if (ret) {
                printf("Regulator: %s - can't set the Voltage!\n",
                       uc_pdata->name);