[PATCH net-next 14/14] net: stmmac: move DMA configuration validation to driver probe
Russell King (Oracle)
rmk+kernel at armlinux.org.uk
Fri Feb 27 01:54:15 PST 2026
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 at armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++-----
1 file 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 a9b26d12a057..5d1cc9aead00 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3249,11 +3249,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;
@@ -7733,6 +7728,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)
--
2.47.3
More information about the linux-arm-kernel
mailing list