diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-01-08 13:52:12 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-12 15:40:18 -0500 |
commit | 3ec7a176fa81107c20f1693c64873c11a6cd8fa4 (patch) | |
tree | 7d469bb3062ecbc25e598acf9d030527a22686a2 /drivers/net/ethernet/apm | |
parent | 78890ed7549444fa9b9ff7e544d6bdd44b4c9566 (diff) |
net: eth: xgene: devm_ioremap() returns NULL on error
devm_ioremap() returns NULL on failure, it doesn't return an ERR_PTR.
Fixes: de7b5b3d790a ('net: eth: xgene: change APM X-Gene SoC platform ethernet to support ACPI')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/apm')
-rw-r--r-- | drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index 1e56bf30366f..02add385a33d 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c @@ -804,9 +804,9 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) return -ENODEV; } pdata->base_addr = devm_ioremap(dev, res->start, resource_size(res)); - if (IS_ERR(pdata->base_addr)) { + if (!pdata->base_addr) { dev_err(dev, "Unable to retrieve ENET Port CSR region\n"); - return PTR_ERR(pdata->base_addr); + return -ENOMEM; } res = platform_get_resource(pdev, IORESOURCE_MEM, RES_RING_CSR); @@ -816,9 +816,9 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) } pdata->ring_csr_addr = devm_ioremap(dev, res->start, resource_size(res)); - if (IS_ERR(pdata->ring_csr_addr)) { + if (!pdata->ring_csr_addr) { dev_err(dev, "Unable to retrieve ENET Ring CSR region\n"); - return PTR_ERR(pdata->ring_csr_addr); + return -ENOMEM; } res = platform_get_resource(pdev, IORESOURCE_MEM, RES_RING_CMD); @@ -828,9 +828,9 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) } pdata->ring_cmd_addr = devm_ioremap(dev, res->start, resource_size(res)); - if (IS_ERR(pdata->ring_cmd_addr)) { + if (!pdata->ring_cmd_addr) { dev_err(dev, "Unable to retrieve ENET Ring command region\n"); - return PTR_ERR(pdata->ring_cmd_addr); + return -ENOMEM; } ret = platform_get_irq(pdev, 0); |