mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 07:04:28 +00:00
regulator: pbias: don't evaluate variable before assignment
We should not evaluate the value of reg before its value is set. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
62896dcbf3
commit
c57b6b7090
1 changed files with 3 additions and 3 deletions
|
@ -225,9 +225,6 @@ static int pbias_regulator_set_value(struct udevice *dev, int uV)
|
|||
int rc;
|
||||
u32 reg;
|
||||
|
||||
debug("Setting %s voltage to %s\n", p->name,
|
||||
(reg & p->vmode) ? "3.0v" : "1.8v");
|
||||
|
||||
rc = pmic_read(dev->parent, 0, (uint8_t *)®, sizeof(reg));
|
||||
if (rc)
|
||||
return rc;
|
||||
|
@ -239,6 +236,9 @@ static int pbias_regulator_set_value(struct udevice *dev, int uV)
|
|||
else
|
||||
return -EINVAL;
|
||||
|
||||
debug("Setting %s voltage to %s\n", p->name,
|
||||
(reg & p->vmode) ? "3.0v" : "1.8v");
|
||||
|
||||
return pmic_write(dev->parent, 0, (uint8_t *)®, sizeof(reg));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue