summaryrefslogtreecommitdiffstats
path: root/drivers/net/orion-gbe.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-31 09:02:47 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-09-16 08:32:10 +0200
commit29b7f95f3bd244a4b4d036e1b3a94a7bfbe3581c (patch)
tree282c0036b7127af4ecb76e6fb214de8a2077bcfb /drivers/net/orion-gbe.c
parent9d518ba397712add7fa06ff3ab056a26a3c46de6 (diff)
downloadbarebox-29b7f95f3bd244a4b4d036e1b3a94a7bfbe3581c.tar.gz
resource: Let dev_get_mem_region return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Diffstat (limited to 'drivers/net/orion-gbe.c')
-rw-r--r--drivers/net/orion-gbe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/orion-gbe.c b/drivers/net/orion-gbe.c
index 991c8a8..ab761ad 100644
--- a/drivers/net/orion-gbe.c
+++ b/drivers/net/orion-gbe.c
@@ -415,6 +415,8 @@ static int port_probe(struct device_d *parent, struct port_priv *port)
port->intf = PHY_INTERFACE_MODE_RGMII;
port->regs = dev_get_mem_region(parent, 0) + PORTn_REGS(port->portno);
+ if (IS_ERR(port->regs))
+ return PTR_ERR(port->regs);
/* allocate rx/tx descriptors and buffers */
port->txdesc = dma_alloc_coherent(ALIGN(sizeof(*port->txdesc), 16));
@@ -490,6 +492,9 @@ static int orion_gbe_probe(struct device_d *dev)
dev->priv = gbe;
gbe->regs = dev_get_mem_region(dev, 0);
+ if (IS_ERR(gbe->regs))
+ return PTR_ERR(gbe->regs);
+
gbe->clk = clk_get(dev, 0);
if (!IS_ERR(gbe->clk))
clk_enable(gbe->clk);