[PATCH 3/3] nvmem: sprd: Determine double data programming from device data

From: Baolin Wang
Date: Fri Mar 13 2020 - 00:08:05 EST


We've saved the double data flag in the device data, so we should
use it when programming a block.

Signed-off-by: Baolin Wang <baolin.wang7@xxxxxxxxx>
---
drivers/nvmem/sprd-efuse.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
index 43b3f6e..925feb2 100644
--- a/drivers/nvmem/sprd-efuse.c
+++ b/drivers/nvmem/sprd-efuse.c
@@ -324,6 +324,7 @@ static int sprd_efuse_read(void *context, u32 offset, void *val, size_t bytes)
static int sprd_efuse_write(void *context, u32 offset, void *val, size_t bytes)
{
struct sprd_efuse *efuse = context;
+ bool blk_double = efuse->data->blk_double;
bool lock;
int ret;

@@ -348,7 +349,7 @@ static int sprd_efuse_write(void *context, u32 offset, void *val, size_t bytes)
else
lock = true;

- ret = sprd_efuse_raw_prog(efuse, offset, false, lock, val);
+ ret = sprd_efuse_raw_prog(efuse, offset, blk_double, lock, val);

clk_disable_unprepare(efuse->clk);

--
1.9.1