Commit 89ab75bf authored by Niklas Cassel's avatar Niklas Cassel Committed by David S. Miller

net: stmmac: return error if no DMA configuration is found

All drivers except pci glue layer calls stmmac_probe_config_dt.
stmmac_probe_config_dt does a kzalloc dma_cfg.

pci glue layer does kzalloc dma_cfg explicitly, so all current
drivers does a kzalloc dma_cfg.

Return an error if no DMA configuration is found, that way
we can assume that the DMA configuration always exists.
Signed-off-by: default avatarNiklas Cassel <niklas.cassel@axis.com>
Acked-by: default avatarAlexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3f0dd6b7
...@@ -1578,16 +1578,12 @@ static void stmmac_check_ether_addr(struct stmmac_priv *priv) ...@@ -1578,16 +1578,12 @@ static void stmmac_check_ether_addr(struct stmmac_priv *priv)
*/ */
static int stmmac_init_dma_engine(struct stmmac_priv *priv) static int stmmac_init_dma_engine(struct stmmac_priv *priv)
{ {
int pbl = DEFAULT_DMA_PBL, fixed_burst = 0, aal = 0;
int mixed_burst = 0;
int atds = 0; int atds = 0;
int ret = 0; int ret = 0;
if (priv->plat->dma_cfg) { if (!priv->plat->dma_cfg) {
pbl = priv->plat->dma_cfg->pbl; dev_err(priv->device, "DMA configuration not found\n");
fixed_burst = priv->plat->dma_cfg->fixed_burst; return -EINVAL;
mixed_burst = priv->plat->dma_cfg->mixed_burst;
aal = priv->plat->dma_cfg->aal;
} }
if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE)) if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE))
...@@ -1599,8 +1595,12 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv) ...@@ -1599,8 +1595,12 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
return ret; return ret;
} }
priv->hw->dma->init(priv->ioaddr, pbl, fixed_burst, mixed_burst, priv->hw->dma->init(priv->ioaddr,
aal, priv->dma_tx_phy, priv->dma_rx_phy, atds); priv->plat->dma_cfg->pbl,
priv->plat->dma_cfg->fixed_burst,
priv->plat->dma_cfg->mixed_burst,
priv->plat->dma_cfg->aal,
priv->dma_tx_phy, priv->dma_rx_phy, atds);
if (priv->synopsys_id >= DWMAC_CORE_4_00) { if (priv->synopsys_id >= DWMAC_CORE_4_00) {
priv->rx_tail_addr = priv->dma_rx_phy + priv->rx_tail_addr = priv->dma_rx_phy +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment