Skip to contentSkip to conversation

net: bcmgenet: remove unused platform code

PATCH Applied Heiner Kallweit 4 participants 5 messages Oct 14, 2025 – Oct 15, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: bcmgenet: remove unused platform code

This effectively reverts b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree"). There has never been an in-tree user of struct bcmgenet_platform_data, all devices use OF or ACPI.

---
 MAINTAINERS                                   |  1 -
 .../net/ethernet/broadcom/genet/bcmgenet.c    | 20 ++---
 drivers/net/ethernet/broadcom/genet/bcmmii.c  | 75 +------------------
 include/linux/platform_data/bcmgenet.h        | 19 -----
 4 files changed, 7 insertions(+), 108 deletions(-)
 delete mode 100644 include/linux/platform_data/bcmgenet.h
MAINTAINERS +0 -1
index 07363437c..cf00f6327 100644
@@ -5111,7 +5111,6 @@ F:	Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml
 F:	drivers/net/ethernet/broadcom/genet/
 F:	drivers/net/ethernet/broadcom/unimac.h
 F:	drivers/net/mdio/mdio-bcm-unimac.c
-F:	include/linux/platform_data/bcmgenet.h
 F:	include/linux/platform_data/mdio-bcm-unimac.h
 
 BROADCOM IPROC ARM ARCHITECTURE
drivers/net/ethernet/broadcom/genet/bcmgenet.c +6 -14
index 98971ae4f..d99ef92fe 100644
@@ -35,7 +35,6 @@
 #include <linux/ip.h>
 #include <linux/ipv6.h>
 #include <linux/phy.h>
-#include <linux/platform_data/bcmgenet.h>
 
 #include <linux/unaligned.h>
 
@@ -3926,7 +3925,6 @@ MODULE_DEVICE_TABLE(of, bcmgenet_match);
 
 static int bcmgenet_probe(struct platform_device *pdev)
 {
-	struct bcmgenet_platform_data *pd = pdev->dev.platform_data;
 	const struct bcmgenet_plat_data *pdata;
 	struct bcmgenet_priv *priv;
 	struct net_device *dev;
@@ -4010,9 +4008,6 @@ static int bcmgenet_probe(struct platform_device *pdev)
 		priv->version = pdata->version;
 		priv->dma_max_burst_length = pdata->dma_max_burst_length;
 		priv->flags = pdata->flags;
-	} else {
-		priv->version = pd->genet_version;
-		priv->dma_max_burst_length = DMA_MAX_BURST_LENGTH;
 	}
 
 	priv->clk = devm_clk_get_optional(&priv->pdev->dev, "enet");
@@ -4062,16 +4057,13 @@ static int bcmgenet_probe(struct platform_device *pdev)
 	if (device_get_phy_mode(&pdev->dev) == PHY_INTERFACE_MODE_INTERNAL)
 		bcmgenet_power_up(priv, GENET_POWER_PASSIVE);
 
-	if (pd && !IS_ERR_OR_NULL(pd->mac_address))
-		eth_hw_addr_set(dev, pd->mac_address);
-	else
-		if (device_get_ethdev_address(&pdev->dev, dev))
-			if (has_acpi_companion(&pdev->dev)) {
-				u8 addr[ETH_ALEN];
+	if (device_get_ethdev_address(&pdev->dev, dev))
+		if (has_acpi_companion(&pdev->dev)) {
+			u8 addr[ETH_ALEN];
 
-				bcmgenet_get_hw_addr(priv, addr);
-				eth_hw_addr_set(dev, addr);
-			}
+			bcmgenet_get_hw_addr(priv, addr);
+			eth_hw_addr_set(dev, addr);
+		}
 
 	if (!is_valid_ether_addr(dev->dev_addr)) {
 		dev_warn(&pdev->dev, "using random Ethernet MAC\n");
drivers/net/ethernet/broadcom/genet/bcmmii.c +1 -74

111 lines not on this page · raw message

include/linux/platform_data/bcmgenet.h deleted +0 -19
deleted file mode 100644
index d8f873862..000000000
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __LINUX_PLATFORM_DATA_BCMGENET_H__
-#define __LINUX_PLATFORM_DATA_BCMGENET_H__
-
-#include <linux/types.h>
-#include <linux/if_ether.h>
-#include <linux/phy.h>
-
-struct bcmgenet_platform_data {
-	bool		mdio_enabled;
-	phy_interface_t	phy_interface;
-	int		phy_address;
-	int		phy_speed;
-	int		phy_duplex;
-	u8		mac_address[ETH_ALEN];
-	int		genet_version;
-};
-
-#endif
Signature · 1 line
2.51.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Heiner Kallweit

This effectively reverts b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree"). There has never been an in-tree user of struct bcmgenet_platform_data, all devices use OF or ACPI.

I'm actually kind of surprised platform driver support was added as recently as 2014. But I guess there was a reason at the time.

maintainer
#2 lore raw
In reply to Simon Horman
Quoted 9 lines · Simon Horman
Quoted 5 lines · Heiner Kallweit

This effectively reverts b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree"). There has never been an in-tree user of struct bcmgenet_platform_data, all devices use OF or ACPI.

I'm actually kind of surprised platform driver support was added as recently as 2014. But I guess there was a reason at the time.

Upstreaming of that driver was done in 2014 and as a result there was interest from a customer at a time to continue to work with the modern driver from upstream copied nearly as-is into the vendor tree, hence support for platform data was submitted and accepted to facilitate that.

Since said platforms are now supported by the BMIPS_GENERIC platform, which is DT only, it makes sense to remove the platform data code now.

Thanks!

Signature · 1 line
Florian
#4 lore raw
In reply to Heiner Kallweit
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 4 lines · On Tue, 14 Oct 2025 08:02:47 +0200 you wrote:

This effectively reverts b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree"). There has never been an in-tree user of struct bcmgenet_platform_data, all devices use OF or ACPI.

Quoted 8 lines
---
 MAINTAINERS                                   |  1 -
 .../net/ethernet/broadcom/genet/bcmgenet.c    | 20 ++---
 drivers/net/ethernet/broadcom/genet/bcmmii.c  | 75 +------------------
 include/linux/platform_data/bcmgenet.h        | 19 -----
 4 files changed, 7 insertions(+), 108 deletions(-)
 delete mode 100644 include/linux/platform_data/bcmgenet.h

Here is the summary with links:
- [net-next] net: bcmgenet: remove unused platform code

    https://git.kernel.org/netdev/net-next/c/378e6523ebb1

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html