mirror of https://gitee.com/openkylin/linux.git
ethernet: apm: xgene: remove unnecessary check
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>
This commit is contained in:
parent
5e9b4dce85
commit
534249d6e0
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue