Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94920128 authored by Fugang Duan's avatar Fugang Duan Committed by David S. Miller
Browse files

net: fec: pass ->dev to dma_alloc__coherent() API



In aarch64 system, it requires to trasfer ->dev to dma_alloc_coherent()
API, otherwise allocate failed and print kernel warning.

Signed-off-by: default avatarFugang Duan <B38611@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 145d6e29
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -2651,7 +2651,7 @@ static void fec_enet_free_queue(struct net_device *ndev)
	for (i = 0; i < fep->num_tx_queues; i++)
	for (i = 0; i < fep->num_tx_queues; i++)
		if (fep->tx_queue[i] && fep->tx_queue[i]->tso_hdrs) {
		if (fep->tx_queue[i] && fep->tx_queue[i]->tso_hdrs) {
			txq = fep->tx_queue[i];
			txq = fep->tx_queue[i];
			dma_free_coherent(NULL,
			dma_free_coherent(&fep->pdev->dev,
					  txq->bd.ring_size * TSO_HEADER_SIZE,
					  txq->bd.ring_size * TSO_HEADER_SIZE,
					  txq->tso_hdrs,
					  txq->tso_hdrs,
					  txq->tso_hdrs_dma);
					  txq->tso_hdrs_dma);
@@ -2685,7 +2685,7 @@ static int fec_enet_alloc_queue(struct net_device *ndev)
		txq->tx_wake_threshold =
		txq->tx_wake_threshold =
			(txq->bd.ring_size - txq->tx_stop_threshold) / 2;
			(txq->bd.ring_size - txq->tx_stop_threshold) / 2;


		txq->tso_hdrs = dma_alloc_coherent(NULL,
		txq->tso_hdrs = dma_alloc_coherent(&fep->pdev->dev,
					txq->bd.ring_size * TSO_HEADER_SIZE,
					txq->bd.ring_size * TSO_HEADER_SIZE,
					&txq->tso_hdrs_dma,
					&txq->tso_hdrs_dma,
					GFP_KERNEL);
					GFP_KERNEL);