net: moxa: Use devm_platform_get_and_ioremap_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 7 Jun 2021 15:02:59 +0000 (23:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:48 +0000 (09:44 +0200)
commit8e4da401425bae82131087b71e862f3adfb22b60
tree73727c1221c3d9002da9a38fcc91daa5f69d6497
parent278dc34b711227be81073b3d81ba81341c520842
net: moxa: Use devm_platform_get_and_ioremap_resource()

[ Upstream commit 35cba15a504bf4f585bb9d78f47b22b28a1a06b2 ]

Use devm_platform_get_and_ioremap_resource() to simplify
code and avoid a null-ptr-deref by checking 'res' in it.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/moxa/moxart_ether.c