Commit c474dd5a authored by Markus Elfring's avatar Markus Elfring Committed by Jakub Kicinski

tsnep: Use devm_platform_get_and_ioremap_resource() in tsnep_probe()

A wrapper function is available since the commit 890cc39a
("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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Tested-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
Link: https://lore.kernel.org/r/29e9dc0f-5597-4fee-be5c-25a5ab4fe2dc@web.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d160c66c
......@@ -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;
......
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