summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/lantiq_xrx200.c
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2021-06-05 15:21:27 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-07 23:05:37 +0300
commitd402af20315c99d85c9310d6f7a00e5aca53e192 (patch)
tree0eda02cfba00c016b06cc89007d049d2ef2e0d9c /drivers/net/ethernet/lantiq_xrx200.c
parent126285651b7f95282a0afe3a1b0221419b31d989 (diff)
downloadlinux-d402af20315c99d85c9310d6f7a00e5aca53e192.tar.xz
net: lantiq: Use devm_platform_get_and_ioremap_resource()
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/lantiq_xrx200.c')
-rw-r--r--drivers/net/ethernet/lantiq_xrx200.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index 36dc3e5f6218..27df06ed355e 100644
--- a/drivers/net/ethernet/lantiq_xrx200.c
+++ b/drivers/net/ethernet/lantiq_xrx200.c
@@ -436,7 +436,6 @@ static int xrx200_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
- struct resource *res;
struct xrx200_priv *priv;
struct net_device *net_dev;
int err;
@@ -456,13 +455,7 @@ static int xrx200_probe(struct platform_device *pdev)
net_dev->max_mtu = XRX200_DMA_DATA_LEN;
/* load the memory ranges */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(dev, "failed to get resources\n");
- return -ENOENT;
- }
-
- priv->pmac_reg = devm_ioremap_resource(dev, res);
+ priv->pmac_reg = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
if (IS_ERR(priv->pmac_reg))
return PTR_ERR(priv->pmac_reg);