Skip to content

Commit 99f4a07

Browse files
haiyuewakartben
authored andcommitted
drivers: eeprom: stm32: simplify write error handling
Remove the extra unlock and value return, just print the error code when failed to do DATAEEPROM_Lock(). Signed-off-by: Haiyue Wang <[email protected]>
1 parent 1446416 commit 99f4a07

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/eeprom/eeprom_stm32.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ static int eeprom_stm32_write(const struct device *dev, off_t offset,
9191
ret = HAL_FLASHEx_DATAEEPROM_Lock();
9292
if (ret) {
9393
LOG_ERR("failed to lock EEPROM (err %d)", ret);
94-
k_mutex_unlock(&lock);
95-
return ret;
9694
}
9795

9896
k_mutex_unlock(&lock);

0 commit comments

Comments
 (0)