Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b961b4f authored by YueHaibing's avatar YueHaibing Committed by Jason Gunthorpe
Browse files

RDMA/hns: Use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.  This is
detected by coccinelle.

Link: https://lore.kernel.org/r/20190906141727.26552-1-yuehaibing@huawei.com


Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent bd0abfa8
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -4517,7 +4517,6 @@ static int hns_roce_get_cfg(struct hns_roce_dev *hr_dev)
	struct platform_device *pdev = NULL;
	struct net_device *netdev = NULL;
	struct device_node *net_node;
	struct resource *res;
	int port_cnt = 0;
	u8 phy_port;
	int ret;
@@ -4556,8 +4555,7 @@ static int hns_roce_get_cfg(struct hns_roce_dev *hr_dev)
	}

	/* get the mapped register base address */
	res = platform_get_resource(hr_dev->pdev, IORESOURCE_MEM, 0);
	hr_dev->reg_base = devm_ioremap_resource(dev, res);
	hr_dev->reg_base = devm_platform_ioremap_resource(hr_dev->pdev, 0);
	if (IS_ERR(hr_dev->reg_base))
		return PTR_ERR(hr_dev->reg_base);