]> Git Repo - linux.git/commitdiff
net: bcmgenet: Fix return value check for fixed_phy_register()
authorRuan Jinjie <[email protected]>
Fri, 18 Aug 2023 05:12:21 +0000 (13:12 +0800)
committerDavid S. Miller <[email protected]>
Sun, 20 Aug 2023 09:58:28 +0000 (10:58 +0100)
The fixed_phy_register() function returns error pointers and never
returns NULL. Update the checks accordingly.

Fixes: b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree")
Signed-off-by: Ruan Jinjie <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Acked-by: Doug Berger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/broadcom/genet/bcmmii.c

index 0092e46c46f83c668bff5833a0d1b3e89c6b63bf..cc3afb605b1ec83a2f988e6af773525e2f8ae7bc 100644 (file)
@@ -617,7 +617,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
                };
 
                phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
-               if (!phydev || IS_ERR(phydev)) {
+               if (IS_ERR(phydev)) {
                        dev_err(kdev, "failed to register fixed PHY device\n");
                        return -ENODEV;
                }
This page took 0.061425 seconds and 4 git commands to generate.