diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2024-02-05 14:22:32 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-02-09 12:27:36 -0800 |
commit | 4a49c88ea5651a77f7b2292ca7d7e2c16e2feac6 (patch) | |
tree | eaa7e093ba038351add945cfcdd23e0ae66db0b9 /drivers/net/ethernet/wiznet | |
parent | f0ddf15f0a74c27eb4b2271a90e69948acc3fa2c (diff) | |
download | lwn-4a49c88ea5651a77f7b2292ca7d7e2c16e2feac6.tar.gz lwn-4a49c88ea5651a77f7b2292ca7d7e2c16e2feac6.zip |
ethernet: wiznet: Use devm_platform_get_and_ioremap_resource() in w5300_hw_probe()
A wrapper function is available since the commit 890cc39a8799
("drivers: provide devm_platform_get_and_ioremap_resource()").
Thus reuse existing functionality instead of keeping duplicate source code.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Link: https://lore.kernel.org/r/46f64db3-3f8f-4c6c-8d70-38daeefccac1@web.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/wiznet')
-rw-r--r-- | drivers/net/ethernet/wiznet/w5300.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c index 3318b50a5911..f165616f36fe 100644 --- a/drivers/net/ethernet/wiznet/w5300.c +++ b/drivers/net/ethernet/wiznet/w5300.c @@ -539,8 +539,7 @@ static int w5300_hw_probe(struct platform_device *pdev) eth_hw_addr_random(ndev); } - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->base = devm_ioremap_resource(&pdev->dev, mem); + priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); if (IS_ERR(priv->base)) return PTR_ERR(priv->base); |