Commit d402af20 authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller

net: lantiq: Use devm_platform_get_and_ioremap_resource()

Use devm_platform_get_and_ioremap_resource() to simplify
code.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 12628565
...@@ -436,7 +436,6 @@ static int xrx200_probe(struct platform_device *pdev) ...@@ -436,7 +436,6 @@ static int xrx200_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
struct resource *res;
struct xrx200_priv *priv; struct xrx200_priv *priv;
struct net_device *net_dev; struct net_device *net_dev;
int err; int err;
...@@ -456,13 +455,7 @@ static int xrx200_probe(struct platform_device *pdev) ...@@ -456,13 +455,7 @@ static int xrx200_probe(struct platform_device *pdev)
net_dev->max_mtu = XRX200_DMA_DATA_LEN; net_dev->max_mtu = XRX200_DMA_DATA_LEN;
/* load the memory ranges */ /* load the memory ranges */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->pmac_reg = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
if (!res) {
dev_err(dev, "failed to get resources\n");
return -ENOENT;
}
priv->pmac_reg = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->pmac_reg)) if (IS_ERR(priv->pmac_reg))
return PTR_ERR(priv->pmac_reg); return PTR_ERR(priv->pmac_reg);
......
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