summaryrefslogtreecommitdiff
path: root/drivers/power/regulator
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/regulator')
-rw-r--r--drivers/power/regulator/act8846.c4
-rw-r--r--drivers/power/regulator/axp_regulator.c1
-rw-r--r--drivers/power/regulator/regulator-uclass.c21
3 files changed, 15 insertions, 11 deletions
diff --git a/drivers/power/regulator/act8846.c b/drivers/power/regulator/act8846.c
index d3e72da0d35..144032692f6 100644
--- a/drivers/power/regulator/act8846.c
+++ b/drivers/power/regulator/act8846.c
@@ -29,7 +29,7 @@ enum {
REG_SYS0,
REG_SYS1,
REG1_VOL = 0x10,
- REG1_CTL = 0X11,
+ REG1_CTL = 0x11,
REG2_VOL0 = 0x20,
REG2_VOL1,
REG2_CTL,
@@ -41,7 +41,7 @@ enum {
REG4_CTL,
REG5_VOL = 0x50,
REG5_CTL,
- REG6_VOL = 0X58,
+ REG6_VOL = 0x58,
REG6_CTL,
REG7_VOL = 0x60,
REG7_CTL,
diff --git a/drivers/power/regulator/axp_regulator.c b/drivers/power/regulator/axp_regulator.c
index 75cdbca30f6..7794a4f5d92 100644
--- a/drivers/power/regulator/axp_regulator.c
+++ b/drivers/power/regulator/axp_regulator.c
@@ -318,6 +318,7 @@ static const struct axp_regulator_plat *const axp_regulators[] = {
[AXP221_ID] = axp22x_regulators,
[AXP223_ID] = axp22x_regulators,
[AXP313_ID] = axp313_regulators,
+ [AXP323_ID] = axp313_regulators,
[AXP717_ID] = axp717_regulators,
[AXP803_ID] = axp803_regulators,
[AXP806_ID] = axp806_regulators,
diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index 09567eb9dbb..2a59a1b79c2 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -260,13 +260,13 @@ int regulator_get_by_platname(const char *plat_name, struct udevice **devp)
*devp = NULL;
- for (ret = uclass_find_first_device(UCLASS_REGULATOR, &dev); dev;
- ret = uclass_find_next_device(&dev)) {
- if (ret) {
- dev_dbg(dev, "ret=%d\n", ret);
- continue;
- }
+ ret = uclass_find_first_device(UCLASS_REGULATOR, &dev);
+ if (ret) {
+ dev_dbg(dev, "ret=%d\n", ret);
+ return ret;
+ }
+ for (; dev; uclass_find_next_device(&dev)) {
uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata || strcmp(plat_name, uc_pdata->name))
continue;
@@ -410,9 +410,12 @@ static bool regulator_name_is_unique(struct udevice *check_dev,
int ret;
int len;
- for (ret = uclass_find_first_device(UCLASS_REGULATOR, &dev); dev;
- ret = uclass_find_next_device(&dev)) {
- if (ret || dev == check_dev)
+ ret = uclass_find_first_device(UCLASS_REGULATOR, &dev);
+ if (ret)
+ return true;
+
+ for (; dev; uclass_find_next_device(&dev)) {
+ if (dev == check_dev)
continue;
uc_pdata = dev_get_uclass_plat(dev);