Commit 6551c8c8 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

net: dsa: lantiq: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3230a55b
......@@ -1822,7 +1822,6 @@ static int gswip_gphy_fw_list(struct gswip_priv *priv,
static int gswip_probe(struct platform_device *pdev)
{
struct gswip_priv *priv;
struct resource *gswip_res, *mdio_res, *mii_res;
struct device_node *mdio_np, *gphy_fw_np;
struct device *dev = &pdev->dev;
int err;
......@@ -1833,18 +1832,15 @@ static int gswip_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
gswip_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->gswip = devm_ioremap_resource(dev, gswip_res);
priv->gswip = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(priv->gswip))
return PTR_ERR(priv->gswip);
mdio_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
priv->mdio = devm_ioremap_resource(dev, mdio_res);
priv->mdio = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(priv->mdio))
return PTR_ERR(priv->mdio);
mii_res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
priv->mii = devm_ioremap_resource(dev, mii_res);
priv->mii = devm_platform_ioremap_resource(pdev, 2);
if (IS_ERR(priv->mii))
return PTR_ERR(priv->mii);
......
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