[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220714132342.13051-1-kda@linux-powerpc.org>
Date: Thu, 14 Jul 2022 16:23:42 +0300
From: Denis Kirjanov <kda@...ux-powerpc.org>
To: netdev@...r.kernel.org
Subject: [PATCH] net: altera: Handle dma_set_coherent_mask error codes
handle the error in the case that DMA mask is not supportyed
Fixes: bbd2190ce96d ("Altera TSE: Add main and header file for Altera Ethernet Driver")
Signed-off-by: Denis Kirjanov <kda@...ux-powerpc.org>
---
drivers/net/ethernet/altera/altera_tse_main.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 8c5828582c21..7773d978321a 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -1439,10 +1439,14 @@ static int altera_tse_probe(struct platform_device *pdev)
}
if (!dma_set_mask(priv->device, DMA_BIT_MASK(priv->dmaops->dmamask))) {
- dma_set_coherent_mask(priv->device,
+ ret = dma_set_coherent_mask(priv->device,
DMA_BIT_MASK(priv->dmaops->dmamask));
+ if (ret)
+ goto err_free_netdev;
} else if (!dma_set_mask(priv->device, DMA_BIT_MASK(32))) {
- dma_set_coherent_mask(priv->device, DMA_BIT_MASK(32));
+ ret = dma_set_coherent_mask(priv->device, DMA_BIT_MASK(32));
+ if (ret)
+ goto err_free_netdev;
} else {
ret = -EIO;
goto err_free_netdev;
--
2.16.4
Powered by blists - more mailing lists