summaryrefslogtreecommitdiff
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2019-12-04 09:48:03 +0800
committerPeng Fan <peng.fan@nxp.com>2019-12-04 18:42:59 +0800
commit51226f91ca478ed020f8aa8801e351447d9b267f (patch)
treeb61da5db19c06dc29427da7309b0461b881da881 /drivers/nvmem
parentee4c49f1e63c10ebad7bc456090a03085bc3a5a5 (diff)
LF-334-2 nvmem: imx-ocotp-scu: align offset with fusemap
The previous offset / 4 maps to fuse map row index, which is not friendly for user. So align with the following patch, update the write to align with fuse row index exactly " nvmem: imx: correct the fuse word index iMX8 fuse word index represent as one 4-bytes word, it should not be divided by 4. Exp: - MAC0 address layout in fuse: offset 708: MAC[3] MAC[2] MAC[1] MAC[0] offset 709: XX xx MAC[5] MAC[4] Signed-off-by: Fugang Duan <fugang.duan@nxp.com> " Reviewed-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/imx-ocotp-scu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvmem/imx-ocotp-scu.c b/drivers/nvmem/imx-ocotp-scu.c
index d2a68c4dc7ae..399e1eb8b4c1 100644
--- a/drivers/nvmem/imx-ocotp-scu.c
+++ b/drivers/nvmem/imx-ocotp-scu.c
@@ -188,10 +188,10 @@ static int imx_scu_ocotp_write(void *context, unsigned int offset,
int ret;
/* allow only writing one complete OTP word at a time */
- if ((bytes != 4) || (offset % 4))
+ if (bytes != 4)
return -EINVAL;
- index = offset >> 2;
+ index = offset;
if (in_hole(context, index))
return -EINVAL;