diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2024-02-05 13:43:14 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-02-07 18:13:58 +0100 |
commit | c474dd5a52df18f255509733f087b5c0b471eb4d (patch) | |
tree | d395cb0ed178f16815d21c37ebe82fe3dfe08345 | |
parent | net: Do not return value from init_dummy_netdev() (diff) | |
download | linux-c474dd5a52df18f255509733f087b5c0b471eb4d.tar.xz linux-c474dd5a52df18f255509733f087b5c0b471eb4d.zip |
tsnep: Use devm_platform_get_and_ioremap_resource() in tsnep_probe()
A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6
("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>
Tested-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Link: https://lore.kernel.org/r/29e9dc0f-5597-4fee-be5c-25a5ab4fe2dc@web.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/ethernet/engleder/tsnep_main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c index 6cb3817d2877..5bf6840c6701 100644 --- a/drivers/net/ethernet/engleder/tsnep_main.c +++ b/drivers/net/ethernet/engleder/tsnep_main.c @@ -2563,8 +2563,7 @@ static int tsnep_probe(struct platform_device *pdev) mutex_init(&adapter->rxnfc_lock); INIT_LIST_HEAD(&adapter->rxnfc_rules); - io = platform_get_resource(pdev, IORESOURCE_MEM, 0); - adapter->addr = devm_ioremap_resource(&pdev->dev, io); + adapter->addr = devm_platform_get_and_ioremap_resource(pdev, 0, &io); if (IS_ERR(adapter->addr)) return PTR_ERR(adapter->addr); netdev->mem_start = io->start; |