Skip to content

Commit

Permalink
net: mdio-ipq4019: Make use of devm_platform_ioremap_resource()
Browse files Browse the repository at this point in the history
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Cai Huoqing authored and David S. Miller committed Aug 31, 2021
1 parent 8d65cd8 commit fa14d03
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/mdio/mdio-ipq4019.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)
{
struct ipq4019_mdio_data *priv;
struct mii_bus *bus;
struct resource *res;
int ret;

bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv));
Expand All @@ -225,9 +224,7 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)
return PTR_ERR(priv->mdio_clk);

/* The platform resource is provided on the chipset IPQ5018 */
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (res)
priv->eth_ldo_rdy = devm_ioremap_resource(&pdev->dev, res);
priv->eth_ldo_rdy = devm_platform_ioremap_resource(pdev, 1);

bus->name = "ipq4019_mdio";
bus->read = ipq4019_mdio_read;
Expand Down

0 comments on commit fa14d03

Please sign in to comment.