Skip to content

Commit

Permalink
net: hns: remove redundant dev_err call in hns_dsaf_get_cfg()
Browse files Browse the repository at this point in the history
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Aug 24, 2016
1 parent a26c767 commit b3dc935
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev)

dsaf_dev->sc_base = devm_ioremap_resource(&pdev->dev,
res);
if (IS_ERR(dsaf_dev->sc_base)) {
dev_err(dsaf_dev->dev, "subctrl can not map!\n");
if (IS_ERR(dsaf_dev->sc_base))
return PTR_ERR(dsaf_dev->sc_base);
}

res = platform_get_resource(pdev, IORESOURCE_MEM,
res_idx++);
Expand All @@ -130,10 +128,8 @@ int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev)

dsaf_dev->sds_base = devm_ioremap_resource(&pdev->dev,
res);
if (IS_ERR(dsaf_dev->sds_base)) {
dev_err(dsaf_dev->dev, "serdes-ctrl can not map!\n");
if (IS_ERR(dsaf_dev->sds_base))
return PTR_ERR(dsaf_dev->sds_base);
}
} else {
dsaf_dev->sub_ctrl = syscon;
}
Expand All @@ -148,10 +144,8 @@ int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev)
}
}
dsaf_dev->ppe_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dsaf_dev->ppe_base)) {
dev_err(dsaf_dev->dev, "ppe-base resource can not map!\n");
if (IS_ERR(dsaf_dev->ppe_base))
return PTR_ERR(dsaf_dev->ppe_base);
}
dsaf_dev->ppe_paddr = res->start;

if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) {
Expand All @@ -167,10 +161,8 @@ int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev)
}
}
dsaf_dev->io_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dsaf_dev->io_base)) {
dev_err(dsaf_dev->dev, "dsaf-base resource can not map!\n");
if (IS_ERR(dsaf_dev->io_base))
return PTR_ERR(dsaf_dev->io_base);
}
}

ret = device_property_read_u32(dsaf_dev->dev, "desc-num", &desc_num);
Expand Down

0 comments on commit b3dc935

Please sign in to comment.