Skip to content

Commit 4282649

Browse files
committed
drivers: flash: max32: Wrap flash read to utilize ECC workaround
Use wrapper function for read operations to allow using the new HAL function that handles ECC checks and erased page detection. Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
1 parent a00ca8d commit 4282649

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/flash/flash_max32.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023-2024 Analog Devices, Inc.
2+
* Copyright (c) 2023-2025 Analog Devices, Inc.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -52,17 +52,18 @@ static inline void max32_sem_give(const struct device *dev)
5252
static int api_read(const struct device *dev, off_t address, void *buffer, size_t length)
5353
{
5454
const struct max32_flash_dev_config *const cfg = dev->config;
55+
int ret = 0;
5556
unsigned int key = 0;
5657

5758
address += cfg->flash_base;
5859

5960
key = irq_lock();
6061

61-
MXC_FLC_Read(address, buffer, length);
62+
ret = Wrap_MXC_FLC_Read(address, buffer, length);
6263

6364
irq_unlock(key);
6465

65-
return 0;
66+
return ret != 0 ? -EIO : 0;
6667
}
6768

6869
static int api_write(const struct device *dev, off_t address, const void *buffer, size_t length)

0 commit comments

Comments
 (0)