summaryrefslogtreecommitdiff
path: root/target/linux/mcs814x/files-3.3/drivers
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-08-08 21:51:09 +0000
committerFlorian Fainelli <florian@openwrt.org>2012-08-08 21:51:09 +0000
commit35351a28b9d700fe890fd3cdefd8b82b3343b5e3 (patch)
tree476888f05ed2b81f920a88759ca5e78c2b857d99 /target/linux/mcs814x/files-3.3/drivers
parentb77494fa2f64003979e144d00cee92b261b3f892 (diff)
downloadmtk-20170518-35351a28b9d700fe890fd3cdefd8b82b3343b5e3.zip
mtk-20170518-35351a28b9d700fe890fd3cdefd8b82b3343b5e3.tar.gz
mtk-20170518-35351a28b9d700fe890fd3cdefd8b82b3343b5e3.tar.bz2
nuport-mac: unmap the DMA buffer when closing device
SVN-Revision: 33068
Diffstat (limited to 'target/linux/mcs814x/files-3.3/drivers')
-rw-r--r--target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
index 38dbe1e..ebf95a6 100644
--- a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
+++ b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
@@ -688,6 +688,10 @@ static void nuport_mac_free_rx_ring(struct nuport_mac_priv *priv)
dev_kfree_skb(priv->rx_skb[i]);
priv->rx_skb[i] = NULL;
}
+
+ if (priv->rx_addr)
+ dma_unmap_single(&priv->pdev->dev, priv->rx_addr, RX_ALLOC_SIZE,
+ DMA_TO_DEVICE);
}
static void nuport_mac_read_mac_address(struct net_device *dev)