mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register"
@ 2022-01-03 19:34 Florian Fainelli
  2022-01-03 20:16 ` Andrew Lunn
  2022-01-04  3:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2022-01-03 19:34 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Andrew Lunn, Heiner Kallweit, Russell King,
	David S. Miller, Jakub Kicinski, Miaoqian Lin, open list

This reverts commit b45396afa4177f2b1ddfeff7185da733fade1dc3 ("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: b45396afa417 ("net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/fixed_phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index a0c256bd5441..c65fb5f5d2dc 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -239,8 +239,8 @@ static struct phy_device *__fixed_phy_register(unsigned int irq,
 	/* 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 */
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register"
  2022-01-03 19:34 [PATCH net] Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register" Florian Fainelli
@ 2022-01-03 20:16 ` Andrew Lunn
  2022-01-04  3:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2022-01-03 20:16 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, Heiner Kallweit, Russell King, David S. Miller,
	Jakub Kicinski, Miaoqian Lin, open list

On Mon, Jan 03, 2022 at 11:34:52AM -0800, Florian Fainelli wrote:
> This reverts commit b45396afa4177f2b1ddfeff7185da733fade1dc3 ("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: b45396afa417 ("net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

I was hoping the original author would fixup the breakage, but it has
been a couple of days now....

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register"
  2022-01-03 19:34 [PATCH net] Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register" Florian Fainelli
  2022-01-03 20:16 ` Andrew Lunn
@ 2022-01-04  3:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-04  3:10 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, andrew, hkallweit1, linux, davem, kuba, linmq006, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  3 Jan 2022 11:34:52 -0800 you wrote:
> This reverts commit b45396afa4177f2b1ddfeff7185da733fade1dc3 ("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
> 
> [...]

Here is the summary with links:
  - [net] Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register"
    https://git.kernel.org/netdev/net/c/065e1ae02fbe

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-04  3:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 19:34 [PATCH net] Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register" Florian Fainelli
2022-01-03 20:16 ` Andrew Lunn
2022-01-04  3:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome