summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns_mdio.c
diff options
context:
space:
mode:
authorJiangfeng Xiao <xiaojiangfeng@huawei.com>2019-07-12 16:16:24 +0300
committerDavid S. Miller <davem@davemloft.net>2019-07-13 01:37:18 +0300
commit56170ba3bd90986e44f96ada9573dfe583621fca (patch)
tree0cd8961ed9968d6a0ba6d02e09916d0669cef89b /drivers/net/ethernet/hisilicon/hns_mdio.c
parent752c2ea2d8e7c23b0f64e2e7d4337f3604d44c9f (diff)
downloadlinux-56170ba3bd90986e44f96ada9573dfe583621fca.tar.xz
net: hisilicon: Use devm_platform_ioremap_resource
Use devm_platform_ioremap_resource instead of devm_ioremap_resource. Make the code simpler. Signed-off-by: Jiangfeng Xiao <xiaojiangfeng@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns_mdio.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns_mdio.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c
index 918cab1c61cd..3e863a71c513 100644
--- a/drivers/net/ethernet/hisilicon/hns_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
@@ -417,7 +417,6 @@ static int hns_mdio_probe(struct platform_device *pdev)
{
struct hns_mdio_device *mdio_dev;
struct mii_bus *new_bus;
- struct resource *res;
int ret = -ENODEV;
if (!pdev) {
@@ -442,8 +441,7 @@ static int hns_mdio_probe(struct platform_device *pdev)
new_bus->priv = mdio_dev;
new_bus->parent = &pdev->dev;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- mdio_dev->vbase = devm_ioremap_resource(&pdev->dev, res);
+ mdio_dev->vbase = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(mdio_dev->vbase)) {
ret = PTR_ERR(mdio_dev->vbase);
return ret;