* [PATCH net-next 0/3] net: macb: Clean up several member settings of macb_config instances
@ 2026-03-10 10:12 Kevin Hao
2026-03-10 10:12 ` [PATCH net-next 1/3] net: macb: Clean up the .clk_init setting in the " Kevin Hao
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Kevin Hao @ 2026-03-10 10:12 UTC (permalink / raw)
To: netdev
Cc: Nicolas Ferre, Claudiu Beznea, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Kevin Hao
Hi,
While debugging an issue in the macb driver, I noticed that many macb_config
instances have very similar member settings. This makes it difficult to
identify the actual differences between these instances. This patch series
aims to clean up some of these settings and clarify the specific configurations
of each macb_config instance. No functional changes are introduced.
---
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
---
Kevin Hao (3):
net: macb: Clean up the .clk_init setting in the macb_config instances
net: macb: Clean up the .init settings in macb_config instances
net: macb: Clean up the .usrio settings in macb_config instances
drivers/net/ethernet/cadence/macb_main.c | 92 ++++++++++++--------------------
1 file changed, 34 insertions(+), 58 deletions(-)
---
base-commit: 343f51842f4ed7143872f3aa116a214a5619a4b9
change-id: 20260309-macb-cleanup-f773e894f2f5
Best regards,
--
Kevin Hao <haokexin@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net-next 1/3] net: macb: Clean up the .clk_init setting in the macb_config instances
2026-03-10 10:12 [PATCH net-next 0/3] net: macb: Clean up several member settings of macb_config instances Kevin Hao
@ 2026-03-10 10:12 ` Kevin Hao
2026-03-10 10:12 ` [PATCH net-next 2/3] net: macb: Clean up the .init settings in " Kevin Hao
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Kevin Hao @ 2026-03-10 10:12 UTC (permalink / raw)
To: netdev
Cc: Nicolas Ferre, Claudiu Beznea, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Kevin Hao
All instances of macb_config currently have .clk_init set, but most of
them use macb_clk_init(). In fact, there is no need to duplicate this
across all macb_config instances. Introduce a new macb_clk_init()
function that executes the specific .clk_init if it is set; otherwise,
it runs the default clock initialization function.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/net/ethernet/cadence/macb_main.c | 41 +++++++++++++++-----------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 3dcae4d5f74c9709a86fae837d25501da4484bf7..82d3f6017287af409d0a1908400d9967e634203e 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4548,9 +4548,9 @@ static void macb_clks_disable(struct clk *pclk, struct clk *hclk, struct clk *tx
clk_bulk_disable_unprepare(ARRAY_SIZE(clks), clks);
}
-static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
- struct clk **hclk, struct clk **tx_clk,
- struct clk **rx_clk, struct clk **tsu_clk)
+static int macb_clk_init_dflt(struct platform_device *pdev, struct clk **pclk,
+ struct clk **hclk, struct clk **tx_clk,
+ struct clk **rx_clk, struct clk **tsu_clk)
{
struct macb_platform_data *pdata;
int err;
@@ -4633,6 +4633,19 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
return err;
}
+static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
+ struct clk **hclk, struct clk **tx_clk,
+ struct clk **rx_clk, struct clk **tsu_clk,
+ const struct macb_config *config)
+{
+ if (config->clk_init)
+ return config->clk_init(pdev, pclk, hclk, tx_clk, rx_clk,
+ tsu_clk);
+ else
+ return macb_clk_init_dflt(pdev, pclk, hclk, tx_clk, rx_clk,
+ tsu_clk);
+}
+
static int macb_init(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
@@ -5241,7 +5254,7 @@ static int fu540_c000_clk_init(struct platform_device *pdev, struct clk **pclk,
struct clk_init_data init;
int err = 0;
- err = macb_clk_init(pdev, pclk, hclk, tx_clk, rx_clk, tsu_clk);
+ err = macb_clk_init_dflt(pdev, pclk, hclk, tx_clk, rx_clk, tsu_clk);
if (err)
return err;
@@ -5389,7 +5402,6 @@ static const struct macb_config fu540_c000_config = {
static const struct macb_config at91sam9260_config = {
.caps = MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5397,7 +5409,6 @@ static const struct macb_config at91sam9260_config = {
static const struct macb_config sama5d3macb_config = {
.caps = MACB_CAPS_SG_DISABLED |
MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5405,7 +5416,6 @@ static const struct macb_config sama5d3macb_config = {
static const struct macb_config pc302gem_config = {
.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5413,7 +5423,6 @@ static const struct macb_config pc302gem_config = {
static const struct macb_config sama5d2_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = macb_init,
.jumbo_max_len = 10240,
.usrio = &macb_default_usrio,
@@ -5422,7 +5431,6 @@ static const struct macb_config sama5d2_config = {
static const struct macb_config sama5d29_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5431,7 +5439,6 @@ static const struct macb_config sama5d3_config = {
.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE |
MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = macb_init,
.jumbo_max_len = 10240,
.usrio = &macb_default_usrio,
@@ -5440,7 +5447,6 @@ static const struct macb_config sama5d3_config = {
static const struct macb_config sama5d4_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
.dma_burst_length = 4,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5454,7 +5460,6 @@ static const struct macb_config emac_config = {
static const struct macb_config np4_config = {
.caps = MACB_CAPS_USRIO_DISABLED,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5464,7 +5469,6 @@ static const struct macb_config zynqmp_config = {
MACB_CAPS_JUMBO |
MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_BD_RD_PREFETCH,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = init_reset_optional,
.jumbo_max_len = 10240,
.usrio = &macb_default_usrio,
@@ -5474,7 +5478,6 @@ static const struct macb_config zynq_config = {
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_NO_GIGABIT_HALF |
MACB_CAPS_NEEDS_RSTONUBR,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5484,7 +5487,6 @@ static const struct macb_config mpfs_config = {
MACB_CAPS_JUMBO |
MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = init_reset_optional,
.usrio = &macb_default_usrio,
.max_tx_length = 4040, /* Cadence Erratum 1686 */
@@ -5496,7 +5498,6 @@ static const struct macb_config sama7g5_gem_config = {
MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &sama7g5_usrio,
};
@@ -5506,7 +5507,6 @@ static const struct macb_config sama7g5_emac_config = {
MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII |
MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &sama7g5_usrio,
};
@@ -5517,7 +5517,6 @@ static const struct macb_config versal_config = {
MACB_CAPS_NEED_TSUCLK | MACB_CAPS_QUEUE_DISABLE |
MACB_CAPS_QBV,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = init_reset_optional,
.jumbo_max_len = 10240,
.usrio = &macb_default_usrio,
@@ -5528,7 +5527,6 @@ static const struct macb_config eyeq5_config = {
MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_QUEUE_DISABLE |
MACB_CAPS_NO_LSO | MACB_CAPS_EEE,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = eyeq5_init,
.jumbo_max_len = 10240,
.usrio = &macb_default_usrio,
@@ -5540,7 +5538,6 @@ static const struct macb_config raspberrypi_rp1_config = {
MACB_CAPS_GEM_HAS_PTP |
MACB_CAPS_EEE,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
.jumbo_max_len = 10240,
@@ -5581,7 +5578,6 @@ static const struct macb_config default_gem_config = {
MACB_CAPS_JUMBO |
MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
.jumbo_max_len = 10240,
@@ -5611,7 +5607,8 @@ static int macb_probe(struct platform_device *pdev)
if (!macb_config)
macb_config = &default_gem_config;
- err = macb_config->clk_init(pdev, &pclk, &hclk, &tx_clk, &rx_clk, &tsu_clk);
+ err = macb_clk_init(pdev, &pclk, &hclk, &tx_clk, &rx_clk, &tsu_clk,
+ macb_config);
if (err)
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next 2/3] net: macb: Clean up the .init settings in macb_config instances
2026-03-10 10:12 [PATCH net-next 0/3] net: macb: Clean up several member settings of macb_config instances Kevin Hao
2026-03-10 10:12 ` [PATCH net-next 1/3] net: macb: Clean up the .clk_init setting in the " Kevin Hao
@ 2026-03-10 10:12 ` Kevin Hao
2026-03-10 10:12 ` [PATCH net-next 3/3] net: macb: Clean up the .usrio " Kevin Hao
2026-03-12 2:10 ` [PATCH net-next 0/3] net: macb: Clean up several member settings of " patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Kevin Hao @ 2026-03-10 10:12 UTC (permalink / raw)
To: netdev
Cc: Nicolas Ferre, Claudiu Beznea, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Kevin Hao
All instances of macb_config currently have the .init field set, but most
of them use macb_init(). In fact, there is no need to duplicate this
across all macb_config instances. Introduce a new macb_init() function
that executes the specific .init if it is set; otherwise, it runs a
default initialization function.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/net/ethernet/cadence/macb_main.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 82d3f6017287af409d0a1908400d9967e634203e..27ec1f16c4f18c2be67f5052fd248ed17ea2281b 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4646,7 +4646,7 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
tsu_clk);
}
-static int macb_init(struct platform_device *pdev)
+static int macb_init_dflt(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
unsigned int hw_q, q;
@@ -4801,6 +4801,15 @@ static int macb_init(struct platform_device *pdev)
return 0;
}
+static int macb_init(struct platform_device *pdev,
+ const struct macb_config *config)
+{
+ if (config->init)
+ return config->init(pdev);
+ else
+ return macb_init_dflt(pdev);
+}
+
static const struct macb_usrio_config macb_default_usrio = {
.mii = MACB_BIT(MII),
.rmii = MACB_BIT(RMII),
@@ -5301,7 +5310,7 @@ static int fu540_c000_init(struct platform_device *pdev)
if (IS_ERR(mgmt->reg))
return PTR_ERR(mgmt->reg);
- return macb_init(pdev);
+ return macb_init_dflt(pdev);
}
static int init_reset_optional(struct platform_device *pdev)
@@ -5351,7 +5360,7 @@ static int init_reset_optional(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, ret, "failed to reset controller");
}
- ret = macb_init(pdev);
+ ret = macb_init_dflt(pdev);
err_out_phy_exit:
if (ret)
@@ -5376,7 +5385,7 @@ static int eyeq5_init(struct platform_device *pdev)
if (ret)
return dev_err_probe(dev, ret, "failed to init PHY\n");
- ret = macb_init(pdev);
+ ret = macb_init_dflt(pdev);
if (ret)
phy_exit(bp->phy);
return ret;
@@ -5402,28 +5411,24 @@ static const struct macb_config fu540_c000_config = {
static const struct macb_config at91sam9260_config = {
.caps = MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
- .init = macb_init,
.usrio = &macb_default_usrio,
};
static const struct macb_config sama5d3macb_config = {
.caps = MACB_CAPS_SG_DISABLED |
MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
- .init = macb_init,
.usrio = &macb_default_usrio,
};
static const struct macb_config pc302gem_config = {
.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
.dma_burst_length = 16,
- .init = macb_init,
.usrio = &macb_default_usrio,
};
static const struct macb_config sama5d2_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO,
.dma_burst_length = 16,
- .init = macb_init,
.jumbo_max_len = 10240,
.usrio = &macb_default_usrio,
};
@@ -5431,7 +5436,6 @@ static const struct macb_config sama5d2_config = {
static const struct macb_config sama5d29_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5439,7 +5443,6 @@ static const struct macb_config sama5d3_config = {
.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE |
MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO,
.dma_burst_length = 16,
- .init = macb_init,
.jumbo_max_len = 10240,
.usrio = &macb_default_usrio,
};
@@ -5447,7 +5450,6 @@ static const struct macb_config sama5d3_config = {
static const struct macb_config sama5d4_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
.dma_burst_length = 4,
- .init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5460,7 +5462,6 @@ static const struct macb_config emac_config = {
static const struct macb_config np4_config = {
.caps = MACB_CAPS_USRIO_DISABLED,
- .init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5478,7 +5479,6 @@ static const struct macb_config zynq_config = {
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_NO_GIGABIT_HALF |
MACB_CAPS_NEEDS_RSTONUBR,
.dma_burst_length = 16,
- .init = macb_init,
.usrio = &macb_default_usrio,
};
@@ -5498,7 +5498,6 @@ static const struct macb_config sama7g5_gem_config = {
MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .init = macb_init,
.usrio = &sama7g5_usrio,
};
@@ -5507,7 +5506,6 @@ static const struct macb_config sama7g5_emac_config = {
MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII |
MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .init = macb_init,
.usrio = &sama7g5_usrio,
};
@@ -5538,7 +5536,6 @@ static const struct macb_config raspberrypi_rp1_config = {
MACB_CAPS_GEM_HAS_PTP |
MACB_CAPS_EEE,
.dma_burst_length = 16,
- .init = macb_init,
.usrio = &macb_default_usrio,
.jumbo_max_len = 10240,
};
@@ -5578,7 +5575,6 @@ static const struct macb_config default_gem_config = {
MACB_CAPS_JUMBO |
MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .init = macb_init,
.usrio = &macb_default_usrio,
.jumbo_max_len = 10240,
};
@@ -5748,7 +5744,7 @@ static int macb_probe(struct platform_device *pdev)
bp->phy_interface = interface;
/* IP specific init */
- err = macb_config->init(pdev);
+ err = macb_init(pdev, macb_config);
if (err)
goto err_out_free_netdev;
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next 3/3] net: macb: Clean up the .usrio settings in macb_config instances
2026-03-10 10:12 [PATCH net-next 0/3] net: macb: Clean up several member settings of macb_config instances Kevin Hao
2026-03-10 10:12 ` [PATCH net-next 1/3] net: macb: Clean up the .clk_init setting in the " Kevin Hao
2026-03-10 10:12 ` [PATCH net-next 2/3] net: macb: Clean up the .init settings in " Kevin Hao
@ 2026-03-10 10:12 ` Kevin Hao
2026-03-12 2:10 ` [PATCH net-next 0/3] net: macb: Clean up several member settings of " patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Kevin Hao @ 2026-03-10 10:12 UTC (permalink / raw)
To: netdev
Cc: Nicolas Ferre, Claudiu Beznea, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Kevin Hao
All instances of macb_config currently have the .usrio set, but most of
them use &macb_default_usrio. In fact, there is no need to duplicate
this across all macb_config instances. Remove the .usrio setting from
instances that use &macb_default_usrio, and ensure that the default is
selected at runtime when no other value is explicitly set.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/net/ethernet/cadence/macb_main.c | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 27ec1f16c4f18c2be67f5052fd248ed17ea2281b..0524109d47531785b63f1207aab9609e63de377e 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -5406,37 +5406,31 @@ static const struct macb_config fu540_c000_config = {
.clk_init = fu540_c000_clk_init,
.init = fu540_c000_init,
.jumbo_max_len = 10240,
- .usrio = &macb_default_usrio,
};
static const struct macb_config at91sam9260_config = {
.caps = MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
- .usrio = &macb_default_usrio,
};
static const struct macb_config sama5d3macb_config = {
.caps = MACB_CAPS_SG_DISABLED |
MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
- .usrio = &macb_default_usrio,
};
static const struct macb_config pc302gem_config = {
.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
.dma_burst_length = 16,
- .usrio = &macb_default_usrio,
};
static const struct macb_config sama5d2_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO,
.dma_burst_length = 16,
.jumbo_max_len = 10240,
- .usrio = &macb_default_usrio,
};
static const struct macb_config sama5d29_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .usrio = &macb_default_usrio,
};
static const struct macb_config sama5d3_config = {
@@ -5444,25 +5438,21 @@ static const struct macb_config sama5d3_config = {
MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO,
.dma_burst_length = 16,
.jumbo_max_len = 10240,
- .usrio = &macb_default_usrio,
};
static const struct macb_config sama5d4_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
.dma_burst_length = 4,
- .usrio = &macb_default_usrio,
};
static const struct macb_config emac_config = {
.caps = MACB_CAPS_NEEDS_RSTONUBR | MACB_CAPS_MACB_IS_EMAC,
.clk_init = at91ether_clk_init,
.init = at91ether_init,
- .usrio = &macb_default_usrio,
};
static const struct macb_config np4_config = {
.caps = MACB_CAPS_USRIO_DISABLED,
- .usrio = &macb_default_usrio,
};
static const struct macb_config zynqmp_config = {
@@ -5472,14 +5462,12 @@ static const struct macb_config zynqmp_config = {
.dma_burst_length = 16,
.init = init_reset_optional,
.jumbo_max_len = 10240,
- .usrio = &macb_default_usrio,
};
static const struct macb_config zynq_config = {
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_NO_GIGABIT_HALF |
MACB_CAPS_NEEDS_RSTONUBR,
.dma_burst_length = 16,
- .usrio = &macb_default_usrio,
};
static const struct macb_config mpfs_config = {
@@ -5488,7 +5476,6 @@ static const struct macb_config mpfs_config = {
MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
.init = init_reset_optional,
- .usrio = &macb_default_usrio,
.max_tx_length = 4040, /* Cadence Erratum 1686 */
.jumbo_max_len = 4040,
};
@@ -5517,7 +5504,6 @@ static const struct macb_config versal_config = {
.dma_burst_length = 16,
.init = init_reset_optional,
.jumbo_max_len = 10240,
- .usrio = &macb_default_usrio,
};
static const struct macb_config eyeq5_config = {
@@ -5527,7 +5513,6 @@ static const struct macb_config eyeq5_config = {
.dma_burst_length = 16,
.init = eyeq5_init,
.jumbo_max_len = 10240,
- .usrio = &macb_default_usrio,
};
static const struct macb_config raspberrypi_rp1_config = {
@@ -5536,7 +5521,6 @@ static const struct macb_config raspberrypi_rp1_config = {
MACB_CAPS_GEM_HAS_PTP |
MACB_CAPS_EEE,
.dma_burst_length = 16,
- .usrio = &macb_default_usrio,
.jumbo_max_len = 10240,
};
@@ -5575,7 +5559,6 @@ static const struct macb_config default_gem_config = {
MACB_CAPS_JUMBO |
MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
- .usrio = &macb_default_usrio,
.jumbo_max_len = 10240,
};
@@ -5662,7 +5645,7 @@ static int macb_probe(struct platform_device *pdev)
bp->wol = 0;
device_set_wakeup_capable(&pdev->dev, 1);
- bp->usrio = macb_config->usrio;
+ bp->usrio = macb_config->usrio ? : &macb_default_usrio;
/* By default we set to partial store and forward mode for zynqmp.
* Disable if not set in devicetree.
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/3] net: macb: Clean up several member settings of macb_config instances
2026-03-10 10:12 [PATCH net-next 0/3] net: macb: Clean up several member settings of macb_config instances Kevin Hao
` (2 preceding siblings ...)
2026-03-10 10:12 ` [PATCH net-next 3/3] net: macb: Clean up the .usrio " Kevin Hao
@ 2026-03-12 2:10 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-12 2:10 UTC (permalink / raw)
To: Kevin Hao
Cc: netdev, nicolas.ferre, claudiu.beznea, andrew+netdev, davem,
edumazet, kuba, pabeni
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 10 Mar 2026 18:12:06 +0800 you wrote:
> Hi,
>
> While debugging an issue in the macb driver, I noticed that many macb_config
> instances have very similar member settings. This makes it difficult to
> identify the actual differences between these instances. This patch series
> aims to clean up some of these settings and clarify the specific configurations
> of each macb_config instance. No functional changes are introduced.
>
> [...]
Here is the summary with links:
- [net-next,1/3] net: macb: Clean up the .clk_init setting in the macb_config instances
https://git.kernel.org/netdev/net-next/c/f97977944d15
- [net-next,2/3] net: macb: Clean up the .init settings in macb_config instances
https://git.kernel.org/netdev/net-next/c/9179711ee2f7
- [net-next,3/3] net: macb: Clean up the .usrio settings in macb_config instances
https://git.kernel.org/netdev/net-next/c/0ae998c4efd6
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] 5+ messages in thread
end of thread, other threads:[~2026-03-12 2:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 10:12 [PATCH net-next 0/3] net: macb: Clean up several member settings of macb_config instances Kevin Hao
2026-03-10 10:12 ` [PATCH net-next 1/3] net: macb: Clean up the .clk_init setting in the " Kevin Hao
2026-03-10 10:12 ` [PATCH net-next 2/3] net: macb: Clean up the .init settings in " Kevin Hao
2026-03-10 10:12 ` [PATCH net-next 3/3] net: macb: Clean up the .usrio " Kevin Hao
2026-03-12 2:10 ` [PATCH net-next 0/3] net: macb: Clean up several member settings of " 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