MLK-13783 char: otp: no need to check bank0/bank1 when prog
authorPeng Fan <peng.fan@nxp.com>
Thu, 19 Jan 2017 07:05:29 +0000 (15:05 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:58:22 +0000 (14:58 -0500)
Bank0/Bank1 are not in ECC mode, so no need to check.
Each bank contains 8 words, so we check (phy_index > 15).

Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/char/fsl_otp.c

index 2c0aa4e..ebeb0fc 100644 (file)
@@ -571,8 +571,8 @@ static ssize_t fsl_otp_store(struct kobject *kobj, struct kobj_attribute *attr,
 
        mutex_lock(&otp_mutex);
 
-       if (fsl_otp->devtype == FSL_OTP_MX7ULP) {
-               phy_index = fsl_otp_word_physical(fsl_otp, index);
+       phy_index = fsl_otp_word_physical(fsl_otp, index);
+       if ((fsl_otp->devtype == FSL_OTP_MX7ULP) && (phy_index > 15)) {
                fsl_otp->set_otp_timing();
                ret = otp_wait_busy(0);
                if (ret)