summaryrefslogtreecommitdiff
path: root/drivers/staging/mt7621-eth
diff options
context:
space:
mode:
authorNeilBrown <neil@brown.name>2018-12-09 16:20:32 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-12 11:55:39 +0100
commit370e0a71012744383b4a3ea8882961b63e626d09 (patch)
treebb4ab647c3f967504db6891d1d8b4b35be8c9de8 /drivers/staging/mt7621-eth
parent852b2876a8a82f2c618da40b881bb07c2d42eb5c (diff)
staging: mt7621-eth: set correct dma mask.
Since commit f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms") changed MIPS dma handling, the eth driver fails because the dma mask is set on the wrong 'struct device'. Move the setting to the correct struct device. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-eth')
-rw-r--r--drivers/staging/mt7621-eth/mtk_eth_soc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/mt7621-eth/mtk_eth_soc.c b/drivers/staging/mt7621-eth/mtk_eth_soc.c
index 363d3c978e02..21a76a8ccc26 100644
--- a/drivers/staging/mt7621-eth/mtk_eth_soc.c
+++ b/drivers/staging/mt7621-eth/mtk_eth_soc.c
@@ -1689,6 +1689,8 @@ static int mtk_open(struct net_device *dev)
struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw;
+ dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
+
if (!atomic_read(&eth->dma_refcnt)) {
int err = mtk_start_dma(eth);
@@ -2062,9 +2064,6 @@ static int mtk_probe(struct platform_device *pdev)
struct clk *sysclk;
int err;
- pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
- pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
-
device_reset(&pdev->dev);
match = of_match_device(of_mtk_match, &pdev->dev);