* [PATCH v3 net-next] net: phy: fixed_phy: remove link gpio support
@ 2025-09-04 6:08 Heiner Kallweit
2025-09-04 12:03 ` Russell King (Oracle)
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Heiner Kallweit @ 2025-09-04 6:08 UTC (permalink / raw)
To: Russell King - ARM Linux, Andrew Lunn, Andrew Lunn, Paolo Abeni,
Eric Dumazet, Jakub Kicinski, David Miller
Cc: netdev@vger.kernel.org, Florian Fainelli
The only user of fixed_phy gpio functionality was here:
arch/arm/boot/dts/nxp/vf/vf610-zii-dev-rev-b.dts
Support for the switch on this board was migrated to phylink
(DSA - mv88e6xxx) years ago, so the functionality is unused now.
Therefore remove it.
Note: There is a very small risk that there's out-of-tree users
who use link gpio with a switch chip not handled by DSA.
However we care about in-tree device trees only.
Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v2:
- fix typo in commit message
v3:
- extend commit message
---
drivers/net/phy/fixed_phy.c | 68 +++----------------------------------
1 file changed, 4 insertions(+), 64 deletions(-)
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index 7f4e1a155..aae7bd4ce 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -17,7 +17,6 @@
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/of.h>
-#include <linux/gpio/consumer.h>
#include <linux/idr.h>
#include <linux/netdevice.h>
#include <linux/linkmode.h>
@@ -36,7 +35,6 @@ struct fixed_phy {
bool no_carrier;
int (*link_update)(struct net_device *, struct fixed_phy_status *);
struct list_head node;
- struct gpio_desc *link_gpiod;
};
static struct fixed_mdio_bus platform_fmb = {
@@ -62,12 +60,6 @@ int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier)
}
EXPORT_SYMBOL_GPL(fixed_phy_change_carrier);
-static void fixed_phy_update(struct fixed_phy *fp)
-{
- if (!fp->no_carrier && fp->link_gpiod)
- fp->status.link = !!gpiod_get_value_cansleep(fp->link_gpiod);
-}
-
static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
{
struct fixed_mdio_bus *fmb = bus->priv;
@@ -82,9 +74,6 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
fp->link_update(fp->phydev->attached_dev,
&fp->status);
- /* Check the GPIO for change in status */
- fixed_phy_update(fp);
-
return swphy_read_reg(reg_num, &fp->status);
}
}
@@ -125,9 +114,8 @@ int fixed_phy_set_link_update(struct phy_device *phydev,
}
EXPORT_SYMBOL_GPL(fixed_phy_set_link_update);
-static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
- const struct fixed_phy_status *status,
- struct gpio_desc *gpiod)
+static int __fixed_phy_add(unsigned int irq, int phy_addr,
+ const struct fixed_phy_status *status)
{
int ret;
struct fixed_mdio_bus *fmb = &platform_fmb;
@@ -146,9 +134,6 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
fp->addr = phy_addr;
fp->status = *status;
- fp->link_gpiod = gpiod;
-
- fixed_phy_update(fp);
list_add_tail(&fp->node, &fmb->phys);
@@ -157,7 +142,7 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
void fixed_phy_add(const struct fixed_phy_status *status)
{
- fixed_phy_add_gpiod(PHY_POLL, 0, status, NULL);
+ __fixed_phy_add(PHY_POLL, 0, status);
}
EXPORT_SYMBOL_GPL(fixed_phy_add);
@@ -171,8 +156,6 @@ static void fixed_phy_del(int phy_addr)
list_for_each_entry_safe(fp, tmp, &fmb->phys, node) {
if (fp->addr == phy_addr) {
list_del(&fp->node);
- if (fp->link_gpiod)
- gpiod_put(fp->link_gpiod);
kfree(fp);
ida_free(&phy_fixed_ida, phy_addr);
return;
@@ -180,48 +163,10 @@ static void fixed_phy_del(int phy_addr)
}
}
-#ifdef CONFIG_OF_GPIO
-static struct gpio_desc *fixed_phy_get_gpiod(struct device_node *np)
-{
- struct device_node *fixed_link_node;
- struct gpio_desc *gpiod;
-
- if (!np)
- return NULL;
-
- fixed_link_node = of_get_child_by_name(np, "fixed-link");
- if (!fixed_link_node)
- return NULL;
-
- /*
- * As the fixed link is just a device tree node without any
- * Linux device associated with it, we simply have obtain
- * the GPIO descriptor from the device tree like this.
- */
- gpiod = fwnode_gpiod_get_index(of_fwnode_handle(fixed_link_node),
- "link", 0, GPIOD_IN, "mdio");
- if (IS_ERR(gpiod) && PTR_ERR(gpiod) != -EPROBE_DEFER) {
- if (PTR_ERR(gpiod) != -ENOENT)
- pr_err("error getting GPIO for fixed link %pOF, proceed without\n",
- fixed_link_node);
- gpiod = NULL;
- }
- of_node_put(fixed_link_node);
-
- return gpiod;
-}
-#else
-static struct gpio_desc *fixed_phy_get_gpiod(struct device_node *np)
-{
- return NULL;
-}
-#endif
-
struct phy_device *fixed_phy_register(const struct fixed_phy_status *status,
struct device_node *np)
{
struct fixed_mdio_bus *fmb = &platform_fmb;
- struct gpio_desc *gpiod;
struct phy_device *phy;
int phy_addr;
int ret;
@@ -229,17 +174,12 @@ struct phy_device *fixed_phy_register(const struct fixed_phy_status *status,
if (!fmb->mii_bus || fmb->mii_bus->state != MDIOBUS_REGISTERED)
return ERR_PTR(-EPROBE_DEFER);
- /* Check if we have a GPIO associated with this fixed phy */
- gpiod = fixed_phy_get_gpiod(np);
- if (IS_ERR(gpiod))
- return ERR_CAST(gpiod);
-
/* Get the next available PHY address, up to PHY_MAX_ADDR */
phy_addr = ida_alloc_max(&phy_fixed_ida, PHY_MAX_ADDR - 1, GFP_KERNEL);
if (phy_addr < 0)
return ERR_PTR(phy_addr);
- ret = fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, gpiod);
+ ret = __fixed_phy_add(PHY_POLL, phy_addr, status);
if (ret < 0) {
ida_free(&phy_fixed_ida, phy_addr);
return ERR_PTR(ret);
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 net-next] net: phy: fixed_phy: remove link gpio support
2025-09-04 6:08 [PATCH v3 net-next] net: phy: fixed_phy: remove link gpio support Heiner Kallweit
@ 2025-09-04 12:03 ` Russell King (Oracle)
2025-09-05 17:57 ` Florian Fainelli
2025-09-06 0:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2025-09-04 12:03 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Andrew Lunn, Andrew Lunn, Paolo Abeni, Eric Dumazet,
Jakub Kicinski, David Miller, netdev@vger.kernel.org,
Florian Fainelli
On Thu, Sep 04, 2025 at 08:08:18AM +0200, Heiner Kallweit wrote:
> The only user of fixed_phy gpio functionality was here:
> arch/arm/boot/dts/nxp/vf/vf610-zii-dev-rev-b.dts
> Support for the switch on this board was migrated to phylink
> (DSA - mv88e6xxx) years ago, so the functionality is unused now.
> Therefore remove it.
>
> Note: There is a very small risk that there's out-of-tree users
> who use link gpio with a switch chip not handled by DSA.
> However we care about in-tree device trees only.
>
> Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks!
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 net-next] net: phy: fixed_phy: remove link gpio support
2025-09-04 6:08 [PATCH v3 net-next] net: phy: fixed_phy: remove link gpio support Heiner Kallweit
2025-09-04 12:03 ` Russell King (Oracle)
@ 2025-09-05 17:57 ` Florian Fainelli
2025-09-06 0:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2025-09-05 17:57 UTC (permalink / raw)
To: Heiner Kallweit, Russell King - ARM Linux, Andrew Lunn,
Andrew Lunn, Paolo Abeni, Eric Dumazet, Jakub Kicinski,
David Miller
Cc: netdev@vger.kernel.org
On 9/3/25 23:08, Heiner Kallweit wrote:
> The only user of fixed_phy gpio functionality was here:
> arch/arm/boot/dts/nxp/vf/vf610-zii-dev-rev-b.dts
> Support for the switch on this board was migrated to phylink
> (DSA - mv88e6xxx) years ago, so the functionality is unused now.
> Therefore remove it.
>
> Note: There is a very small risk that there's out-of-tree users
> who use link gpio with a switch chip not handled by DSA.
> However we care about in-tree device trees only.
>
> Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 net-next] net: phy: fixed_phy: remove link gpio support
2025-09-04 6:08 [PATCH v3 net-next] net: phy: fixed_phy: remove link gpio support Heiner Kallweit
2025-09-04 12:03 ` Russell King (Oracle)
2025-09-05 17:57 ` Florian Fainelli
@ 2025-09-06 0:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-06 0:50 UTC (permalink / raw)
To: Heiner Kallweit
Cc: linux, andrew, andrew+netdev, pabeni, edumazet, kuba, davem,
netdev, f.fainelli
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 4 Sep 2025 08:08:18 +0200 you wrote:
> The only user of fixed_phy gpio functionality was here:
> arch/arm/boot/dts/nxp/vf/vf610-zii-dev-rev-b.dts
> Support for the switch on this board was migrated to phylink
> (DSA - mv88e6xxx) years ago, so the functionality is unused now.
> Therefore remove it.
>
> Note: There is a very small risk that there's out-of-tree users
> who use link gpio with a switch chip not handled by DSA.
> However we care about in-tree device trees only.
>
> [...]
Here is the summary with links:
- [v3,net-next] net: phy: fixed_phy: remove link gpio support
https://git.kernel.org/netdev/net-next/c/43a42b85162a
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] 4+ messages in thread
end of thread, other threads:[~2025-09-06 0:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04 6:08 [PATCH v3 net-next] net: phy: fixed_phy: remove link gpio support Heiner Kallweit
2025-09-04 12:03 ` Russell King (Oracle)
2025-09-05 17:57 ` Florian Fainelli
2025-09-06 0:50 ` 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;
as well as URLs for NNTP newsgroup(s).