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 <haiyuewa@163.com>
This commit is contained in:
Haiyue Wang 2025-04-05 21:45:52 +08:00 committed by Benjamin Cabé
commit 99f4a078d2

View file

@ -91,8 +91,6 @@ static int eeprom_stm32_write(const struct device *dev, off_t offset,
ret = HAL_FLASHEx_DATAEEPROM_Lock();
if (ret) {
LOG_ERR("failed to lock EEPROM (err %d)", ret);
k_mutex_unlock(&lock);
return ret;
}
k_mutex_unlock(&lock);