regulator: pbias: don't evaluate variable before assignment
PATCH 1/1 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 <[email protected]>
--- drivers/power/regulator/pbias_regulator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/power/regulator/pbias_regulator.c +3 -3
@@ -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)); }
Signature · 1 line
2.16.2
PATCH 1/1 regulator: pbias: don't evaluate variable before assignment
Quoted 6 lines · Heinrich Schuchardt
We should not evaluate the value of reg before its value is set.
Signed-off-by Heinrich Schuchardt <[email protected]>--- drivers/power/regulator/pbias_regulator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by Simon Glass <[email protected]>
PATCH 1/1 regulator: pbias: don't evaluate variable before assignment
In reply to Heinrich SchuchardtQuoted 4 lines · Heinrich Schuchardt
We should not evaluate the value of reg before its value is set.
Signed-off-by Heinrich Schuchardt <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180407/f839c3e9/attachment.sig>