This reverts commit
5bd649166faf66557a5f63edb0dfa88089aa7a0e ("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: 5bd649166faf ("net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220103193453.1214961-1-f.fainelli@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Check if we have a GPIO associated with this fixed phy */
if (!gpiod) {
gpiod = fixed_phy_get_gpiod(np);
- if (!gpiod)
- return ERR_PTR(-EINVAL);
+ if (IS_ERR(gpiod))
+ return ERR_CAST(gpiod);
}
/* Get the next available PHY address, up to PHY_MAX_ADDR */