diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-05-31 09:12:38 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-02 08:37:23 +0200 |
commit | 829d119ed6b70d13a489442d8a545cf1e66bdc7b (patch) | |
tree | fa1026c1e21c55a413652561bece7fdb7f7fe7ae /arch/arm/include | |
parent | 156c6c0c62b5238d828a33a4cea1000e10aa0d30 (diff) | |
download | barebox-829d119ed6b70d13a489442d8a545cf1e66bdc7b.tar.gz |
ARM: <asm/memory.h>: propagate error codes from arm_add_mem_device()
barebox_add_memory_bank() can fail if the to-be-added memory region
has been requested before. This can happen most easily on i.MX and
STM32MP1 boards:
- The /memory node in the device tree requests a region
- The DDR controller driver requests an overlapping region after
reading back RAM configuration.
This most often leads to error messages down the road, but it can be
difficult to pinpoint the cause. Propagate the error code from
arm_add_mem_device(), so DDR controller drivers can fail their probe
on error.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210531071239.30653-6-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/memory.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 52114d0c4e..2279306179 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -10,10 +10,10 @@ */ #define UL(x) _AC(x, UL) -static inline void arm_add_mem_device(const char* name, resource_size_t start, - resource_size_t size) +static inline int arm_add_mem_device(const char* name, resource_size_t start, + resource_size_t size) { - barebox_add_memory_bank(name, start, size); + return barebox_add_memory_bank(name, start, size); } #endif /* __ASM_ARM_MEMORY_H */ |