Skip to content

Commit 065e1ae

Browse files
ffainellikuba-moo
authored andcommitted
Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register"
This reverts commit b45396a ("net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register") since it prevents any system that uses a fixed PHY without a GPIO descriptor from properly working: [ 5.971952] brcm-systemport 9300000.ethernet: failed to register fixed PHY [ 5.978854] brcm-systemport: probe of 9300000.ethernet failed with error -22 [ 5.986047] brcm-systemport 9400000.ethernet: failed to register fixed PHY [ 5.992947] brcm-systemport: probe of 9400000.ethernet failed with error -22 Fixes: b45396a ("net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register") Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 95bdba2 commit 065e1ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/phy/fixed_phy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ static struct phy_device *__fixed_phy_register(unsigned int irq,
239239
/* Check if we have a GPIO associated with this fixed phy */
240240
if (!gpiod) {
241241
gpiod = fixed_phy_get_gpiod(np);
242-
if (!gpiod)
243-
return ERR_PTR(-EINVAL);
242+
if (IS_ERR(gpiod))
243+
return ERR_CAST(gpiod);
244244
}
245245

246246
/* Get the next available PHY address, up to PHY_MAX_ADDR */

0 commit comments

Comments
 (0)