Commit fa14d03e authored by Cai Huoqing's avatar Cai Huoqing Committed by David S. Miller

net: mdio-ipq4019: Make use of devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8d65cd8d
...@@ -207,7 +207,6 @@ static int ipq4019_mdio_probe(struct platform_device *pdev) ...@@ -207,7 +207,6 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)
{ {
struct ipq4019_mdio_data *priv; struct ipq4019_mdio_data *priv;
struct mii_bus *bus; struct mii_bus *bus;
struct resource *res;
int ret; int ret;
bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv)); bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv));
...@@ -225,9 +224,7 @@ static int ipq4019_mdio_probe(struct platform_device *pdev) ...@@ -225,9 +224,7 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)
return PTR_ERR(priv->mdio_clk); return PTR_ERR(priv->mdio_clk);
/* The platform resource is provided on the chipset IPQ5018 */ /* The platform resource is provided on the chipset IPQ5018 */
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); priv->eth_ldo_rdy = devm_platform_ioremap_resource(pdev, 1);
if (res)
priv->eth_ldo_rdy = devm_ioremap_resource(&pdev->dev, res);
bus->name = "ipq4019_mdio"; bus->name = "ipq4019_mdio";
bus->read = ipq4019_mdio_read; bus->read = ipq4019_mdio_read;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment