From: Yang Yingliang Date: Fri, 11 Jun 2021 08:04:09 +0000 (+0800) Subject: net: mdio: mscc-miim: Use devm_platform_get_and_ioremap_resource() X-Git-Tag: accepted/tizen/unified/20230118.172025~6942^2~205 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ee1a0eed16a221c7078848ac165d4d57dad8784;p=platform%2Fkernel%2Flinux-rpi.git net: mdio: mscc-miim: Use devm_platform_get_and_ioremap_resource() Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller --- diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c index b36e5ea..2d67e12 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -139,10 +139,6 @@ static int mscc_miim_probe(struct platform_device *pdev) struct mscc_miim_dev *dev; int ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; - bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*dev)); if (!bus) return -ENOMEM; @@ -155,7 +151,7 @@ static int mscc_miim_probe(struct platform_device *pdev) bus->parent = &pdev->dev; dev = bus->priv; - dev->regs = devm_ioremap_resource(&pdev->dev, res); + dev->regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(dev->regs)) { dev_err(&pdev->dev, "Unable to map MIIM registers\n"); return PTR_ERR(dev->regs);