summaryrefslogtreecommitdiffstats
path: root/drivers/amba
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-31 08:38:08 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-09-16 08:32:09 +0200
commitdde56d42ad1763dd81a3de65b74d7387d12f6fa9 (patch)
tree888d48be1b4beaaa73195f1879a9369d84c5af88 /drivers/amba
parent82ed2054665a2c6caa7b7a69143583e051289812 (diff)
downloadbarebox-dde56d42ad1763dd81a3de65b74d7387d12f6fa9.tar.gz
barebox-dde56d42ad1763dd81a3de65b74d7387d12f6fa9.tar.xz
resource: Let request_iomem_region return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/amba')
-rw-r--r--drivers/amba/bus.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 6106252264..b934e1182d 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <driver.h>
#include <linux/clk.h>
+#include <linux/err.h>
#include <linux/amba/bus.h>
#include <io.h>
#include <init.h>
@@ -115,8 +116,8 @@ int amba_device_add(struct amba_device *dev)
*/
size = resource_size(&dev->res);
res = request_iomem_region("amba", dev->res.start, dev->res.end);
- if (!res)
- return -ENOMEM;
+ if (IS_ERR(res))
+ return PTR_ERR(res);
dev->base = tmp = (void __force __iomem *)res->start;
if (!tmp) {
ret = -ENOMEM;