summaryrefslogtreecommitdiffstats
path: root/common/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/memory.c')
-rw-r--r--common/memory.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/memory.c b/common/memory.c
index c56455002a..57c73abb22 100644
--- a/common/memory.c
+++ b/common/memory.c
@@ -124,8 +124,8 @@ int barebox_add_memory_bank(const char *name, resource_size_t start,
struct device_d *dev;
bank->res = request_iomem_region(name, start, start + size - 1);
- if (!bank->res)
- return -EBUSY;
+ if (IS_ERR(bank->res))
+ return PTR_ERR(bank->res);
dev = add_mem_device(name, start, size, IORESOURCE_MEM_WRITEABLE);