ethernet: apm: xgene: remove unnecessary check
authorVarka Bhadram <varkabhadram@gmail.com>
Fri, 24 Oct 2014 02:12:07 +0000 (07:42 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Oct 2014 23:16:01 +0000 (19:16 -0400)
devm_ioremap_resource checks platform_get_resource() return value.
We can remove the duplicate check here.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apm/xgene/xgene_enet_main.c

index 3c208cc6f6bb470ae97d74f06fbaf0dcbaaf7ee6..f22659438436222968616df38eaccfdb1e1908a8 100644 (file)
@@ -761,10 +761,6 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
        ndev = pdata->ndev;
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "enet_csr");
-       if (!res) {
-               dev_err(dev, "Resource enet_csr not defined\n");
-               return -ENODEV;
-       }
        pdata->base_addr = devm_ioremap_resource(dev, res);
        if (IS_ERR(pdata->base_addr)) {
                dev_err(dev, "Unable to retrieve ENET Port CSR region\n");
@@ -772,10 +768,6 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
        }
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ring_csr");
-       if (!res) {
-               dev_err(dev, "Resource ring_csr not defined\n");
-               return -ENODEV;
-       }
        pdata->ring_csr_addr = devm_ioremap_resource(dev, res);
        if (IS_ERR(pdata->ring_csr_addr)) {
                dev_err(dev, "Unable to retrieve ENET Ring CSR region\n");
@@ -783,10 +775,6 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
        }
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ring_cmd");
-       if (!res) {
-               dev_err(dev, "Resource ring_cmd not defined\n");
-               return -ENODEV;
-       }
        pdata->ring_cmd_addr = devm_ioremap_resource(dev, res);
        if (IS_ERR(pdata->ring_cmd_addr)) {
                dev_err(dev, "Unable to retrieve ENET Ring command region\n");