MLK-14275: regulator: pf1550-regulator-rpmsg: clear 'u32 val' before read value by...
authorRobin Gong <yibin.gong@nxp.com>
Mon, 27 Feb 2017 08:25:00 +0000 (16:25 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:21:56 +0000 (15:21 -0500)
Actually, m4 only fill the least 1byte, so we'd better clear 'val' before
reading by rpmsg, thus the gabage data will not bother us.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
(cherry picked from commit df3428c6588a00fa153a3b6996cc33b21b69efb6)

drivers/regulator/pf1550-regulator-rpmsg.c

index 57404ea..11a8933 100644 (file)
@@ -382,6 +382,7 @@ static ssize_t pf1550_registers_show(struct device *dev,
 
                msg.header.cmd = PF1550_GET_REG;
                msg.reg = i;
+               msg.val = 0;
 
                err = pf1550_send_message(&msg, info);
                if (err)