diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2020-05-08 13:11:14 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-05-09 08:28:24 +0300 |
commit | da384effb1609b1333d475e9d4b318913b3d194b (patch) | |
tree | 2d6c15d1f0c02c9631e1b2ac3d136178d51077e8 /drivers/net/dsa | |
parent | 3712c1c2ef2a0cbca633d150e568deb8f63a6f29 (diff) | |
download | linux-da384effb1609b1333d475e9d4b318913b3d194b.tar.xz |
net: dsa: vsc73xx: convert to devm_platform_ioremap_resource
Use the helper function that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/vitesse-vsc73xx-platform.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/net/dsa/vitesse-vsc73xx-platform.c b/drivers/net/dsa/vitesse-vsc73xx-platform.c index 0541785f9fee..5e54a5726aa4 100644 --- a/drivers/net/dsa/vitesse-vsc73xx-platform.c +++ b/drivers/net/dsa/vitesse-vsc73xx-platform.c @@ -89,7 +89,6 @@ static int vsc73xx_platform_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct vsc73xx_platform *vsc_platform; - struct resource *res = NULL; int ret; vsc_platform = devm_kzalloc(dev, sizeof(*vsc_platform), GFP_KERNEL); @@ -103,14 +102,7 @@ static int vsc73xx_platform_probe(struct platform_device *pdev) vsc_platform->vsc.ops = &vsc73xx_platform_ops; /* obtain I/O memory space */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "cannot obtain I/O memory space\n"); - ret = -ENXIO; - return ret; - } - - vsc_platform->base_addr = devm_ioremap_resource(&pdev->dev, res); + vsc_platform->base_addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(vsc_platform->base_addr)) { dev_err(&pdev->dev, "cannot request I/O memory space\n"); ret = -ENXIO; |