summaryrefslogtreecommitdiff
path: root/drivers/misc/stm32mp_fuse.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/stm32mp_fuse.c')
-rw-r--r--drivers/misc/stm32mp_fuse.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/misc/stm32mp_fuse.c b/drivers/misc/stm32mp_fuse.c
index 2d661351a1..33943a231b 100644
--- a/drivers/misc/stm32mp_fuse.c
+++ b/drivers/misc/stm32mp_fuse.c
@@ -29,6 +29,9 @@ int fuse_read(u32 bank, u32 word, u32 *val)
return ret;
ret = misc_read(dev, word * 4 + STM32_BSEC_SHADOW_OFFSET,
val, 4);
+ if (ret < 0)
+ return ret;
+ ret = 0;
break;
default:
@@ -54,6 +57,9 @@ int fuse_prog(u32 bank, u32 word, u32 val)
return ret;
ret = misc_write(dev, word * 4 + STM32_BSEC_OTP_OFFSET,
&val, 4);
+ if (ret < 0)
+ return ret;
+ ret = 0;
break;
default:
@@ -78,6 +84,9 @@ int fuse_sense(u32 bank, u32 word, u32 *val)
if (ret)
return ret;
ret = misc_read(dev, word * 4 + STM32_BSEC_OTP_OFFSET, val, 4);
+ if (ret < 0)
+ return ret;
+ ret = 0;
break;
default:
@@ -103,6 +112,9 @@ int fuse_override(u32 bank, u32 word, u32 val)
return ret;
ret = misc_write(dev, word * 4 + STM32_BSEC_SHADOW_OFFSET,
&val, 4);
+ if (ret < 0)
+ return ret;
+ ret = 0;
break;
default: