summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2026-02-27 12:54:15 +0300
committerJakub Kicinski <kuba@kernel.org>2026-03-03 05:35:07 +0300
commit07a8531d44272a1b9fd646f5fc09fc397e5b8a65 (patch)
tree76a2351694501955d07ea244546661721f094daf
parent93cde989bd280b5930ed4852f832d87feb001533 (diff)
downloadlinux-07a8531d44272a1b9fd646f5fc09fc397e5b8a65.tar.xz
net: stmmac: move DMA configuration validation to driver probe
Move the DMA configuration validation from stmmac_init_dma_engine() to the start of the driver probe function. The platform glue is expected to supply the DMA configuration, and a non-zero programmable burst length (bpl). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/E1vvuY3-0000000Avnq-1Spv@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1a054453d05e..029e9b518160 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3244,11 +3244,6 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
u32 chan = 0;
int ret = 0;
- if (!priv->plat->dma_cfg || !priv->plat->dma_cfg->pbl) {
- netdev_err(priv->dev, "Invalid DMA configuration\n");
- return -EINVAL;
- }
-
ret = stmmac_prereset_configure(priv);
if (ret)
return ret;
@@ -7728,6 +7723,11 @@ static int __stmmac_dvr_probe(struct device *device,
u32 rxq;
int i, ret = 0;
+ if (!plat_dat->dma_cfg || !plat_dat->dma_cfg->pbl) {
+ dev_err(device, "invalid DMA configuration\n");
+ return -EINVAL;
+ }
+
ndev = devm_alloc_etherdev_mqs(device, sizeof(struct stmmac_priv),
MTL_MAX_TX_QUEUES, MTL_MAX_RX_QUEUES);
if (!ndev)