From: Fugang Duan <fugang.duan@nxp.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <bhutchings@solarflare.com>,
<stephen@networkplumber.org>, <fugang.duan@nxp.com>
Subject: [PATCH net-next 3/6] net: fec: pass ->dev to dma_alloc__coherent() API
Date: Tue, 11 Apr 2017 19:13:05 +0800 [thread overview]
Message-ID: <1491909188-8971-4-git-send-email-fugang.duan@nxp.com> (raw)
In-Reply-To: <1491909188-8971-1-git-send-email-fugang.duan@nxp.com>
In aarch64 system, it requires to trasfer ->dev to dma_alloc_coherent()
API, otherwise allocate failed and print kernel warning.
Signed-off-by: Fugang Duan <B38611@freescale.com>
---
drivers/net/ethernet/freescale/fec_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 172624c..bcf8675 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2651,7 +2651,7 @@ static void fec_enet_free_queue(struct net_device *ndev)
for (i = 0; i < fep->num_tx_queues; i++)
if (fep->tx_queue[i] && fep->tx_queue[i]->tso_hdrs) {
txq = fep->tx_queue[i];
- dma_free_coherent(NULL,
+ dma_free_coherent(&fep->pdev->dev,
txq->bd.ring_size * TSO_HEADER_SIZE,
txq->tso_hdrs,
txq->tso_hdrs_dma);
@@ -2685,7 +2685,7 @@ static int fec_enet_alloc_queue(struct net_device *ndev)
txq->tx_wake_threshold =
(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->tso_hdrs_dma,
GFP_KERNEL);
--
1.9.1
next prev parent reply other threads:[~2017-04-11 11:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-11 11:13 [PATCH net-next 0/6] net: fec: driver code clean Fugang Duan
2017-04-11 11:13 ` [PATCH net-next 1/6] net: fec: add return value check after calling .of_property_read_u32() Fugang Duan
2017-04-11 11:13 ` [PATCH net-next 2/6] net: fec: avoid BD pointer type cast to 32bit Fugang Duan
2017-04-11 11:13 ` Fugang Duan [this message]
2017-04-11 11:13 ` [PATCH net-next 4/6] net: fec: add phy-reset-gpios PROBE_DEFER check Fugang Duan
2017-04-11 11:13 ` [PATCH net-next 5/6] net: fec: correct the errata number comment typo Fugang Duan
2017-04-11 11:13 ` [PATCH net-next 6/6] net: fec: add ERR007885 for i.MX6ul enet IP Fugang Duan
2017-04-11 18:36 ` [PATCH net-next 0/6] net: fec: driver code clean David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1491909188-8971-4-git-send-email-fugang.duan@nxp.com \
--to=fugang.duan@nxp.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).