Skip to content

Commit c727c6f

Browse files
committed
Merge branch 'fixed_phy_register-return-value'
Ruan Jinjie says: ==================== net: Fix return value check for fixed_phy_register() The fixed_phy_register() function returns error pointers and never returns NULL. Update the checks accordingly. Changes in v3: - Drop the error fix patch for fixed_phy_get_gpiod(). - Split the error code update code into another patch set as suggested. - Update the commit title and message. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents a0e026e + 32bbe64 commit c727c6f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/net/ethernet/broadcom/bgmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
14481448
int err;
14491449

14501450
phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
1451-
if (!phy_dev || IS_ERR(phy_dev)) {
1451+
if (IS_ERR(phy_dev)) {
14521452
dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
14531453
return -ENODEV;
14541454
}

drivers/net/ethernet/broadcom/genet/bcmmii.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
617617
};
618618

619619
phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
620-
if (!phydev || IS_ERR(phydev)) {
620+
if (IS_ERR(phydev)) {
621621
dev_err(kdev, "failed to register fixed PHY device\n");
622622
return -ENODEV;
623623
}

0 commit comments

Comments
 (0)