]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: fs_enet: Fix wrong check in do_pd_setup
authorZheng Yongjun <zhengyongjun3@huawei.com>
Thu, 8 Sep 2022 13:55:13 +0000 (13:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:15:39 +0000 (13:15 +0200)
[ Upstream commit ec3f06b542a960806a81345042e4eee3f8c5dec4 ]

Should check of_iomap return value 'fep->fec.fecp' instead of 'fep->fcc.fccp'

Fixes: 976de6a8c304 ("fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/fs_enet/mac-fec.c

index 777beffa1e1e900d0b6e87fde3742cfa921ea83e..7861a5025dfb7fc1d0196d89e3dac8f45bfd0df0 100644 (file)
@@ -103,7 +103,7 @@ static int do_pd_setup(struct fs_enet_private *fep)
                return -EINVAL;
 
        fep->fec.fecp = of_iomap(ofdev->dev.of_node, 0);
-       if (!fep->fcc.fccp)
+       if (!fep->fec.fecp)
                return -EINVAL;
 
        return 0;