ethernet: 8390: remove unnecessary check of mem
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 27 Sep 2022 15:14:06 +0000 (23:14 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 29 Sep 2022 09:05:23 +0000 (11:05 +0200)
The 'mem' returned by platform_get_resource() has been checked in probe
function, so it is no need do this check in remove function.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220927151406.797800-1-yangyingliang@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/8390/mcf8390.c

index 21047ae1bc3d3d49700afe1a59550de0b4ddfdb3..8a7918d33419652c1ebe6474adcd43634858db99 100644 (file)
@@ -450,8 +450,7 @@ static int mcf8390_remove(struct platform_device *pdev)
 
        unregister_netdev(dev);
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (mem)
-               release_mem_region(mem->start, resource_size(mem));
+       release_mem_region(mem->start, resource_size(mem));
        free_netdev(dev);
        return 0;
 }