netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements
@ 2025-05-17 20:33 Heiner Kallweit
  2025-05-17 20:34 ` [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add Heiner Kallweit
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Heiner Kallweit @ 2025-05-17 20:33 UTC (permalink / raw)
  To: Greg Ungerer, Geert Uytterhoeven, Hauke Mehrtens,
	Rafał Miłecki, Thomas Bogendoerfer, Vladimir Oltean,
	Doug Berger, Florian Fainelli, Thangaraj Samynathan,
	Rengarajan Sundararajan, Microchip Linux Driver Support,
	Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, David Miller,
	Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Broadcom internal kernel review list, linux-m68k, linux-mips,
	Linux USB Mailing List, netdev@vger.kernel.org

This series includes two types of changes:
- All callers pass PHY_POLL, therefore remove irq argument
- constify the passed struct fixed_phy_status *status

Heiner Kallweit (3):
  net: phy: fixed_phy: remove irq argument from fixed_phy_add
  net: phy: fixed_phy: remove irq argument from fixed_phy_register
  net: phy: fixed_phy: constify status argument where possible

 arch/m68k/coldfire/m5272.c                   |  2 +-
 arch/mips/bcm47xx/setup.c                    |  2 +-
 drivers/net/dsa/dsa_loop.c                   |  2 +-
 drivers/net/ethernet/broadcom/bgmac.c        |  2 +-
 drivers/net/ethernet/broadcom/genet/bcmmii.c |  2 +-
 drivers/net/ethernet/faraday/ftgmac100.c     |  2 +-
 drivers/net/mdio/of_mdio.c                   |  2 +-
 drivers/net/phy/fixed_phy.c                  | 12 +++++-------
 drivers/net/usb/lan78xx.c                    |  2 +-
 include/linux/phy_fixed.h                    | 18 ++++++++----------
 10 files changed, 21 insertions(+), 25 deletions(-)

-- 
2.49.0


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

* [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add
  2025-05-17 20:33 [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements Heiner Kallweit
@ 2025-05-17 20:34 ` Heiner Kallweit
  2025-05-20  7:21   ` Simon Horman
                     ` (2 more replies)
  2025-05-17 20:35 ` [PATCH net-next 2/3] net: phy: fixed_phy: remove irq argument from fixed_phy_register Heiner Kallweit
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 12+ messages in thread
From: Heiner Kallweit @ 2025-05-17 20:34 UTC (permalink / raw)
  To: Greg Ungerer, Geert Uytterhoeven, Hauke Mehrtens,
	Rafał Miłecki, Thomas Bogendoerfer, Vladimir Oltean,
	Doug Berger, Florian Fainelli, Thangaraj Samynathan,
	Rengarajan Sundararajan, Microchip Linux Driver Support,
	Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, David Miller,
	Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Broadcom internal kernel review list, linux-m68k, linux-mips,
	Linux USB Mailing List, netdev@vger.kernel.org

All callers pass PHY_POLL, therefore remove irq argument from
fixed_phy_add().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 arch/m68k/coldfire/m5272.c  | 2 +-
 arch/mips/bcm47xx/setup.c   | 2 +-
 drivers/net/phy/fixed_phy.c | 5 ++---
 include/linux/phy_fixed.h   | 5 ++---
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/m68k/coldfire/m5272.c b/arch/m68k/coldfire/m5272.c
index 734dab657..5b70dfdab 100644
--- a/arch/m68k/coldfire/m5272.c
+++ b/arch/m68k/coldfire/m5272.c
@@ -119,7 +119,7 @@ static struct fixed_phy_status nettel_fixed_phy_status __initdata = {
 static int __init init_BSP(void)
 {
 	m5272_uarts_init();
-	fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status);
+	fixed_phy_add(0, &nettel_fixed_phy_status);
 	clkdev_add_table(m5272_clk_lookup, ARRAY_SIZE(m5272_clk_lookup));
 	return 0;
 }
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 247be207f..de426a474 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -282,7 +282,7 @@ static int __init bcm47xx_register_bus_complete(void)
 	bcm47xx_leds_register();
 	bcm47xx_workarounds();
 
-	fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
+	fixed_phy_add(0, &bcm47xx_fixed_phy_status);
 	return 0;
 }
 device_initcall(bcm47xx_register_bus_complete);
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index c91adf246..34a71f223 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -160,10 +160,9 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
 	return 0;
 }
 
-int fixed_phy_add(unsigned int irq, int phy_addr,
-		  struct fixed_phy_status *status)
+int fixed_phy_add(int phy_addr, struct fixed_phy_status *status)
 {
-	return fixed_phy_add_gpiod(irq, phy_addr, status, NULL);
+	return fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, NULL);
 }
 EXPORT_SYMBOL_GPL(fixed_phy_add);
 
diff --git a/include/linux/phy_fixed.h b/include/linux/phy_fixed.h
index 3392c09b5..316bb4ded 100644
--- a/include/linux/phy_fixed.h
+++ b/include/linux/phy_fixed.h
@@ -17,8 +17,7 @@ struct net_device;
 
 #if IS_ENABLED(CONFIG_FIXED_PHY)
 extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
-extern int fixed_phy_add(unsigned int irq, int phy_id,
-			 struct fixed_phy_status *status);
+int fixed_phy_add(int phy_id, struct fixed_phy_status *status);
 extern struct phy_device *fixed_phy_register(unsigned int irq,
 					     struct fixed_phy_status *status,
 					     struct device_node *np);
@@ -28,7 +27,7 @@ extern int fixed_phy_set_link_update(struct phy_device *phydev,
 			int (*link_update)(struct net_device *,
 					   struct fixed_phy_status *));
 #else
-static inline int fixed_phy_add(unsigned int irq, int phy_id,
+static inline int fixed_phy_add(int phy_id,
 				struct fixed_phy_status *status)
 {
 	return -ENODEV;
-- 
2.49.0



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

* [PATCH net-next 2/3] net: phy: fixed_phy: remove irq argument from fixed_phy_register
  2025-05-17 20:33 [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements Heiner Kallweit
  2025-05-17 20:34 ` [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add Heiner Kallweit
@ 2025-05-17 20:35 ` Heiner Kallweit
  2025-05-20  7:21   ` Simon Horman
  2025-05-20 17:59   ` Florian Fainelli
  2025-05-17 20:37 ` [PATCH net-next 3/3] net: phy: fixed_phy: constify status argument where possible Heiner Kallweit
  2025-05-21  1:20 ` [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements patchwork-bot+netdevbpf
  3 siblings, 2 replies; 12+ messages in thread
From: Heiner Kallweit @ 2025-05-17 20:35 UTC (permalink / raw)
  To: Greg Ungerer, Geert Uytterhoeven, Hauke Mehrtens,
	Rafał Miłecki, Thomas Bogendoerfer, Vladimir Oltean,
	Doug Berger, Florian Fainelli, Thangaraj Samynathan,
	Rengarajan Sundararajan, Microchip Linux Driver Support,
	Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, David Miller,
	Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Broadcom internal kernel review list, linux-m68k, linux-mips,
	Linux USB Mailing List, netdev@vger.kernel.org

All callers pass PHY_POLL, therefore remove irq argument from
fixed_phy_register().

Note: I keep the irq argument in fixed_phy_add_gpiod() for now,
for the case that somebody may want to use a GPIO interrupt in
the future, by e.g. adding a call to fwnode_irq_get() to
fixed_phy_get_gpiod().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/dsa/dsa_loop.c                   |  2 +-
 drivers/net/ethernet/broadcom/bgmac.c        |  2 +-
 drivers/net/ethernet/broadcom/genet/bcmmii.c |  2 +-
 drivers/net/ethernet/faraday/ftgmac100.c     |  2 +-
 drivers/net/mdio/of_mdio.c                   |  2 +-
 drivers/net/phy/fixed_phy.c                  |  5 ++---
 drivers/net/usb/lan78xx.c                    |  2 +-
 include/linux/phy_fixed.h                    | 11 +++++------
 8 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
index adbab544c..d8a35f25a 100644
--- a/drivers/net/dsa/dsa_loop.c
+++ b/drivers/net/dsa/dsa_loop.c
@@ -405,7 +405,7 @@ static int __init dsa_loop_init(void)
 	unsigned int i, ret;
 
 	for (i = 0; i < NUM_FIXED_PHYS; i++)
-		phydevs[i] = fixed_phy_register(PHY_POLL, &status, NULL);
+		phydevs[i] = fixed_phy_register(&status, NULL);
 
 	ret = mdio_driver_register(&dsa_loop_drv);
 	if (ret)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index a461ec612..3e9c57196 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1446,7 +1446,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
 	struct phy_device *phy_dev;
 	int err;
 
-	phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
+	phy_dev = fixed_phy_register(&fphy_status, NULL);
 	if (IS_ERR(phy_dev)) {
 		dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
 		return PTR_ERR(phy_dev);
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 71c619d2b..b6437ba7a 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -625,7 +625,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
 			.asym_pause = 0,
 		};
 
-		phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
+		phydev = fixed_phy_register(&fphy_status, NULL);
 		if (IS_ERR(phydev)) {
 			dev_err(kdev, "failed to register fixed PHY device\n");
 			return PTR_ERR(phydev);
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 17ec35e75..a98d5af3f 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1906,7 +1906,7 @@ static int ftgmac100_probe(struct platform_device *pdev)
 			goto err_phy_connect;
 		}
 
-		phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, np);
+		phydev = fixed_phy_register(&ncsi_phy_status, np);
 		if (IS_ERR(phydev)) {
 			dev_err(&pdev->dev, "failed to register fixed PHY device\n");
 			err = PTR_ERR(phydev);
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index 2f4fc664d..98f667b12 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -458,7 +458,7 @@ int of_phy_register_fixed_link(struct device_node *np)
 	return -ENODEV;
 
 register_phy:
-	return PTR_ERR_OR_ZERO(fixed_phy_register(PHY_POLL, &status, np));
+	return PTR_ERR_OR_ZERO(fixed_phy_register(&status, np));
 }
 EXPORT_SYMBOL(of_phy_register_fixed_link);
 
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index 34a71f223..ea002a137 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -222,8 +222,7 @@ static struct gpio_desc *fixed_phy_get_gpiod(struct device_node *np)
 }
 #endif
 
-struct phy_device *fixed_phy_register(unsigned int irq,
-				      struct fixed_phy_status *status,
+struct phy_device *fixed_phy_register(struct fixed_phy_status *status,
 				      struct device_node *np)
 {
 	struct fixed_mdio_bus *fmb = &platform_fmb;
@@ -245,7 +244,7 @@ struct phy_device *fixed_phy_register(unsigned int irq,
 	if (phy_addr < 0)
 		return ERR_PTR(phy_addr);
 
-	ret = fixed_phy_add_gpiod(irq, phy_addr, status, gpiod);
+	ret = fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, gpiod);
 	if (ret < 0) {
 		ida_free(&phy_fixed_ida, phy_addr);
 		return ERR_PTR(ret);
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 8c2488563..759dab980 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2639,7 +2639,7 @@ static struct phy_device *lan78xx_register_fixed_phy(struct lan78xx_net *dev)
 	netdev_info(dev->net,
 		    "No PHY found on LAN7801 – registering fixed PHY (e.g. EVB-KSZ9897-1)\n");
 
-	return fixed_phy_register(PHY_POLL, &fphy_status, NULL);
+	return fixed_phy_register(&fphy_status, NULL);
 }
 
 /**
diff --git a/include/linux/phy_fixed.h b/include/linux/phy_fixed.h
index 316bb4ded..634149a73 100644
--- a/include/linux/phy_fixed.h
+++ b/include/linux/phy_fixed.h
@@ -18,9 +18,8 @@ struct net_device;
 #if IS_ENABLED(CONFIG_FIXED_PHY)
 extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
 int fixed_phy_add(int phy_id, struct fixed_phy_status *status);
-extern struct phy_device *fixed_phy_register(unsigned int irq,
-					     struct fixed_phy_status *status,
-					     struct device_node *np);
+struct phy_device *fixed_phy_register(struct fixed_phy_status *status,
+				      struct device_node *np);
 
 extern void fixed_phy_unregister(struct phy_device *phydev);
 extern int fixed_phy_set_link_update(struct phy_device *phydev,
@@ -32,9 +31,9 @@ static inline int fixed_phy_add(int phy_id,
 {
 	return -ENODEV;
 }
-static inline struct phy_device *fixed_phy_register(unsigned int irq,
-						struct fixed_phy_status *status,
-						struct device_node *np)
+static inline struct phy_device *
+fixed_phy_register(struct fixed_phy_status *status,
+		   struct device_node *np)
 {
 	return ERR_PTR(-ENODEV);
 }
-- 
2.49.0



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

* [PATCH net-next 3/3] net: phy: fixed_phy: constify status argument where possible
  2025-05-17 20:33 [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements Heiner Kallweit
  2025-05-17 20:34 ` [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add Heiner Kallweit
  2025-05-17 20:35 ` [PATCH net-next 2/3] net: phy: fixed_phy: remove irq argument from fixed_phy_register Heiner Kallweit
@ 2025-05-17 20:37 ` Heiner Kallweit
  2025-05-20  7:21   ` Simon Horman
  2025-05-20 18:02   ` Florian Fainelli
  2025-05-21  1:20 ` [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements patchwork-bot+netdevbpf
  3 siblings, 2 replies; 12+ messages in thread
From: Heiner Kallweit @ 2025-05-17 20:37 UTC (permalink / raw)
  To: Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, David Miller,
	Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: netdev@vger.kernel.org

Constify the passed struct fixed_phy_status *status where possible.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/fixed_phy.c | 6 +++---
 include/linux/phy_fixed.h   | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index ea002a137..033656d57 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -131,7 +131,7 @@ 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,
-			       struct fixed_phy_status *status,
+			       const struct fixed_phy_status *status,
 			       struct gpio_desc *gpiod)
 {
 	int ret;
@@ -160,7 +160,7 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
 	return 0;
 }
 
-int fixed_phy_add(int phy_addr, struct fixed_phy_status *status)
+int fixed_phy_add(int phy_addr, const struct fixed_phy_status *status)
 {
 	return fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, NULL);
 }
@@ -222,7 +222,7 @@ static struct gpio_desc *fixed_phy_get_gpiod(struct device_node *np)
 }
 #endif
 
-struct phy_device *fixed_phy_register(struct fixed_phy_status *status,
+struct phy_device *fixed_phy_register(const struct fixed_phy_status *status,
 				      struct device_node *np)
 {
 	struct fixed_mdio_bus *fmb = &platform_fmb;
diff --git a/include/linux/phy_fixed.h b/include/linux/phy_fixed.h
index 634149a73..5399b9e41 100644
--- a/include/linux/phy_fixed.h
+++ b/include/linux/phy_fixed.h
@@ -17,8 +17,8 @@ struct net_device;
 
 #if IS_ENABLED(CONFIG_FIXED_PHY)
 extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
-int fixed_phy_add(int phy_id, struct fixed_phy_status *status);
-struct phy_device *fixed_phy_register(struct fixed_phy_status *status,
+int fixed_phy_add(int phy_id, const struct fixed_phy_status *status);
+struct phy_device *fixed_phy_register(const struct fixed_phy_status *status,
 				      struct device_node *np);
 
 extern void fixed_phy_unregister(struct phy_device *phydev);
@@ -27,12 +27,12 @@ extern int fixed_phy_set_link_update(struct phy_device *phydev,
 					   struct fixed_phy_status *));
 #else
 static inline int fixed_phy_add(int phy_id,
-				struct fixed_phy_status *status)
+				const struct fixed_phy_status *status)
 {
 	return -ENODEV;
 }
 static inline struct phy_device *
-fixed_phy_register(struct fixed_phy_status *status,
+fixed_phy_register(const struct fixed_phy_status *status,
 		   struct device_node *np)
 {
 	return ERR_PTR(-ENODEV);
-- 
2.49.0


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

* Re: [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add
  2025-05-17 20:34 ` [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add Heiner Kallweit
@ 2025-05-20  7:21   ` Simon Horman
  2025-05-20 17:57   ` Florian Fainelli
  2025-05-20 23:29   ` Greg Ungerer
  2 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2025-05-20  7:21 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Greg Ungerer, Geert Uytterhoeven, Hauke Mehrtens,
	Rafał Miłecki, Thomas Bogendoerfer, Vladimir Oltean,
	Doug Berger, Florian Fainelli, Thangaraj Samynathan,
	Rengarajan Sundararajan, Microchip Linux Driver Support,
	Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, David Miller,
	Jakub Kicinski, Paolo Abeni, Eric Dumazet,
	Broadcom internal kernel review list, linux-m68k, linux-mips,
	Linux USB Mailing List, netdev@vger.kernel.org

On Sat, May 17, 2025 at 10:34:32PM +0200, Heiner Kallweit wrote:
> All callers pass PHY_POLL, therefore remove irq argument from
> fixed_phy_add().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net-next 2/3] net: phy: fixed_phy: remove irq argument from fixed_phy_register
  2025-05-17 20:35 ` [PATCH net-next 2/3] net: phy: fixed_phy: remove irq argument from fixed_phy_register Heiner Kallweit
@ 2025-05-20  7:21   ` Simon Horman
  2025-05-20 17:59   ` Florian Fainelli
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Horman @ 2025-05-20  7:21 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Greg Ungerer, Geert Uytterhoeven, Hauke Mehrtens,
	Rafał Miłecki, Thomas Bogendoerfer, Vladimir Oltean,
	Doug Berger, Florian Fainelli, Thangaraj Samynathan,
	Rengarajan Sundararajan, Microchip Linux Driver Support,
	Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, David Miller,
	Jakub Kicinski, Paolo Abeni, Eric Dumazet,
	Broadcom internal kernel review list, linux-m68k, linux-mips,
	Linux USB Mailing List, netdev@vger.kernel.org

On Sat, May 17, 2025 at 10:35:56PM +0200, Heiner Kallweit wrote:
> All callers pass PHY_POLL, therefore remove irq argument from
> fixed_phy_register().
> 
> Note: I keep the irq argument in fixed_phy_add_gpiod() for now,
> for the case that somebody may want to use a GPIO interrupt in
> the future, by e.g. adding a call to fwnode_irq_get() to
> fixed_phy_get_gpiod().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net-next 3/3] net: phy: fixed_phy: constify status argument where possible
  2025-05-17 20:37 ` [PATCH net-next 3/3] net: phy: fixed_phy: constify status argument where possible Heiner Kallweit
@ 2025-05-20  7:21   ` Simon Horman
  2025-05-20 18:02   ` Florian Fainelli
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Horman @ 2025-05-20  7:21 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, David Miller,
	Jakub Kicinski, Paolo Abeni, Eric Dumazet, netdev@vger.kernel.org

On Sat, May 17, 2025 at 10:37:29PM +0200, Heiner Kallweit wrote:
> Constify the passed struct fixed_phy_status *status where possible.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add
  2025-05-17 20:34 ` [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add Heiner Kallweit
  2025-05-20  7:21   ` Simon Horman
@ 2025-05-20 17:57   ` Florian Fainelli
  2025-05-20 23:29   ` Greg Ungerer
  2 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2025-05-20 17:57 UTC (permalink / raw)
  To: Heiner Kallweit, Greg Ungerer, Geert Uytterhoeven, Hauke Mehrtens,
	Rafał Miłecki, Thomas Bogendoerfer, Vladimir Oltean,
	Doug Berger, Thangaraj Samynathan, Rengarajan Sundararajan,
	Microchip Linux Driver Support, Andrew Lunn, Andrew Lunn,
	Russell King - ARM Linux, David Miller, Jakub Kicinski,
	Paolo Abeni, Eric Dumazet
  Cc: Broadcom internal kernel review list, linux-m68k, linux-mips,
	Linux USB Mailing List, netdev@vger.kernel.org

On 5/17/25 13:34, Heiner Kallweit wrote:
> All callers pass PHY_POLL, therefore remove irq argument from
> fixed_phy_add().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

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

* Re: [PATCH net-next 2/3] net: phy: fixed_phy: remove irq argument from fixed_phy_register
  2025-05-17 20:35 ` [PATCH net-next 2/3] net: phy: fixed_phy: remove irq argument from fixed_phy_register Heiner Kallweit
  2025-05-20  7:21   ` Simon Horman
@ 2025-05-20 17:59   ` Florian Fainelli
  1 sibling, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2025-05-20 17:59 UTC (permalink / raw)
  To: Heiner Kallweit, Greg Ungerer, Geert Uytterhoeven, Hauke Mehrtens,
	Rafał Miłecki, Thomas Bogendoerfer, Vladimir Oltean,
	Doug Berger, Thangaraj Samynathan, Rengarajan Sundararajan,
	Microchip Linux Driver Support, Andrew Lunn, Andrew Lunn,
	Russell King - ARM Linux, David Miller, Jakub Kicinski,
	Paolo Abeni, Eric Dumazet
  Cc: Broadcom internal kernel review list, linux-m68k, linux-mips,
	Linux USB Mailing List, netdev@vger.kernel.org

On 5/17/25 13:35, Heiner Kallweit wrote:
> All callers pass PHY_POLL, therefore remove irq argument from
> fixed_phy_register().
> 
> Note: I keep the irq argument in fixed_phy_add_gpiod() for now,
> for the case that somebody may want to use a GPIO interrupt in
> the future, by e.g. adding a call to fwnode_irq_get() to
> fixed_phy_get_gpiod().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

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

* Re: [PATCH net-next 3/3] net: phy: fixed_phy: constify status argument where possible
  2025-05-17 20:37 ` [PATCH net-next 3/3] net: phy: fixed_phy: constify status argument where possible Heiner Kallweit
  2025-05-20  7:21   ` Simon Horman
@ 2025-05-20 18:02   ` Florian Fainelli
  1 sibling, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2025-05-20 18:02 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, Andrew Lunn,
	Russell King - ARM Linux, David Miller, Jakub Kicinski,
	Paolo Abeni, Eric Dumazet
  Cc: netdev@vger.kernel.org

On 5/17/25 13:37, Heiner Kallweit wrote:
> Constify the passed struct fixed_phy_status *status where possible.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian


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

* Re: [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add
  2025-05-17 20:34 ` [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add Heiner Kallweit
  2025-05-20  7:21   ` Simon Horman
  2025-05-20 17:57   ` Florian Fainelli
@ 2025-05-20 23:29   ` Greg Ungerer
  2 siblings, 0 replies; 12+ messages in thread
From: Greg Ungerer @ 2025-05-20 23:29 UTC (permalink / raw)
  To: Heiner Kallweit, Geert Uytterhoeven, Hauke Mehrtens,
	Rafał Miłecki, Thomas Bogendoerfer, Vladimir Oltean,
	Doug Berger, Florian Fainelli, Thangaraj Samynathan,
	Rengarajan Sundararajan, Microchip Linux Driver Support,
	Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, David Miller,
	Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: Broadcom internal kernel review list, linux-m68k, linux-mips,
	Linux USB Mailing List, netdev@vger.kernel.org

Hi Heiner,

On 18/5/25 06:34, Heiner Kallweit wrote:
> All callers pass PHY_POLL, therefore remove irq argument from
> fixed_phy_add().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>   arch/m68k/coldfire/m5272.c  | 2 +-
>   arch/mips/bcm47xx/setup.c   | 2 +-
>   drivers/net/phy/fixed_phy.c | 5 ++---
>   include/linux/phy_fixed.h   | 5 ++---
>   4 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/m68k/coldfire/m5272.c b/arch/m68k/coldfire/m5272.c
> index 734dab657..5b70dfdab 100644
> --- a/arch/m68k/coldfire/m5272.c
> +++ b/arch/m68k/coldfire/m5272.c
> @@ -119,7 +119,7 @@ static struct fixed_phy_status nettel_fixed_phy_status __initdata = {
>   static int __init init_BSP(void)
>   {
>   	m5272_uarts_init();
> -	fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status);
> +	fixed_phy_add(0, &nettel_fixed_phy_status);
>   	clkdev_add_table(m5272_clk_lookup, ARRAY_SIZE(m5272_clk_lookup));
>   	return 0;
>   }

Acked-by: Greg Ungerer <gerg@linux-m68k.org>

Regards
Greg


> diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
> index 247be207f..de426a474 100644
> --- a/arch/mips/bcm47xx/setup.c
> +++ b/arch/mips/bcm47xx/setup.c
> @@ -282,7 +282,7 @@ static int __init bcm47xx_register_bus_complete(void)
>   	bcm47xx_leds_register();
>   	bcm47xx_workarounds();
>   
> -	fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
> +	fixed_phy_add(0, &bcm47xx_fixed_phy_status);
>   	return 0;
>   }
>   device_initcall(bcm47xx_register_bus_complete);
> diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
> index c91adf246..34a71f223 100644
> --- a/drivers/net/phy/fixed_phy.c
> +++ b/drivers/net/phy/fixed_phy.c
> @@ -160,10 +160,9 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
>   	return 0;
>   }
>   
> -int fixed_phy_add(unsigned int irq, int phy_addr,
> -		  struct fixed_phy_status *status)
> +int fixed_phy_add(int phy_addr, struct fixed_phy_status *status)
>   {
> -	return fixed_phy_add_gpiod(irq, phy_addr, status, NULL);
> +	return fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, NULL);
>   }
>   EXPORT_SYMBOL_GPL(fixed_phy_add);
>   
> diff --git a/include/linux/phy_fixed.h b/include/linux/phy_fixed.h
> index 3392c09b5..316bb4ded 100644
> --- a/include/linux/phy_fixed.h
> +++ b/include/linux/phy_fixed.h
> @@ -17,8 +17,7 @@ struct net_device;
>   
>   #if IS_ENABLED(CONFIG_FIXED_PHY)
>   extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
> -extern int fixed_phy_add(unsigned int irq, int phy_id,
> -			 struct fixed_phy_status *status);
> +int fixed_phy_add(int phy_id, struct fixed_phy_status *status);
>   extern struct phy_device *fixed_phy_register(unsigned int irq,
>   					     struct fixed_phy_status *status,
>   					     struct device_node *np);
> @@ -28,7 +27,7 @@ extern int fixed_phy_set_link_update(struct phy_device *phydev,
>   			int (*link_update)(struct net_device *,
>   					   struct fixed_phy_status *));
>   #else
> -static inline int fixed_phy_add(unsigned int irq, int phy_id,
> +static inline int fixed_phy_add(int phy_id,
>   				struct fixed_phy_status *status)
>   {
>   	return -ENODEV;


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

* Re: [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements
  2025-05-17 20:33 [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements Heiner Kallweit
                   ` (2 preceding siblings ...)
  2025-05-17 20:37 ` [PATCH net-next 3/3] net: phy: fixed_phy: constify status argument where possible Heiner Kallweit
@ 2025-05-21  1:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-21  1:20 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: gerg, geert, hauke, zajec5, tsbogend, olteanv, opendmb,
	florian.fainelli, Thangaraj.S, Rengarajan.S, UNGLinuxDriver,
	andrew, andrew+netdev, linux, davem, kuba, pabeni, edumazet,
	bcm-kernel-feedback-list, linux-m68k, linux-mips, linux-usb,
	netdev

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 17 May 2025 22:33:23 +0200 you wrote:
> This series includes two types of changes:
> - All callers pass PHY_POLL, therefore remove irq argument
> - constify the passed struct fixed_phy_status *status
> 
> Heiner Kallweit (3):
>   net: phy: fixed_phy: remove irq argument from fixed_phy_add
>   net: phy: fixed_phy: remove irq argument from fixed_phy_register
>   net: phy: fixed_phy: constify status argument where possible
> 
> [...]

Here is the summary with links:
  - [net-next,1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add
    https://git.kernel.org/netdev/net-next/c/3f1716ee0f6c
  - [net-next,2/3] net: phy: fixed_phy: remove irq argument from fixed_phy_register
    https://git.kernel.org/netdev/net-next/c/d23b4af5df39
  - [net-next,3/3] net: phy: fixed_phy: constify status argument where possible
    https://git.kernel.org/netdev/net-next/c/4ba1c5bb4811

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] 12+ messages in thread

end of thread, other threads:[~2025-05-21  1:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-17 20:33 [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements Heiner Kallweit
2025-05-17 20:34 ` [PATCH net-next 1/3] net: phy: fixed_phy: remove irq argument from fixed_phy_add Heiner Kallweit
2025-05-20  7:21   ` Simon Horman
2025-05-20 17:57   ` Florian Fainelli
2025-05-20 23:29   ` Greg Ungerer
2025-05-17 20:35 ` [PATCH net-next 2/3] net: phy: fixed_phy: remove irq argument from fixed_phy_register Heiner Kallweit
2025-05-20  7:21   ` Simon Horman
2025-05-20 17:59   ` Florian Fainelli
2025-05-17 20:37 ` [PATCH net-next 3/3] net: phy: fixed_phy: constify status argument where possible Heiner Kallweit
2025-05-20  7:21   ` Simon Horman
2025-05-20 18:02   ` Florian Fainelli
2025-05-21  1:20 ` [PATCH net-next 0/3] net: phy: fixed_phy: simplifications and improvements 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).