diff options
Diffstat (limited to 'drivers/net/stmmac')
-rw-r--r-- | drivers/net/stmmac/dwmac100.c | 8 | ||||
-rw-r--r-- | drivers/net/stmmac/dwmac1000_core.c | 6 | ||||
-rw-r--r-- | drivers/net/stmmac/stmmac_main.c | 13 |
3 files changed, 13 insertions, 14 deletions
diff --git a/drivers/net/stmmac/dwmac100.c b/drivers/net/stmmac/dwmac100.c index 803b0373d843..c0a1c9df3ac7 100644 --- a/drivers/net/stmmac/dwmac100.c +++ b/drivers/net/stmmac/dwmac100.c | |||
@@ -138,7 +138,7 @@ static void dwmac100_dump_dma_regs(unsigned long ioaddr) | |||
138 | { | 138 | { |
139 | int i; | 139 | int i; |
140 | 140 | ||
141 | DBG(KERN_DEBUG "DWMAC 100 DMA CSR \n"); | 141 | DBG(KERN_DEBUG "DWMAC 100 DMA CSR\n"); |
142 | for (i = 0; i < 9; i++) | 142 | for (i = 0; i < 9; i++) |
143 | pr_debug("\t CSR%d (offset 0x%x): 0x%08x\n", i, | 143 | pr_debug("\t CSR%d (offset 0x%x): 0x%08x\n", i, |
144 | (DMA_BUS_MODE + i * 4), | 144 | (DMA_BUS_MODE + i * 4), |
@@ -316,7 +316,7 @@ static void dwmac100_set_filter(struct net_device *dev) | |||
316 | MAC_CONTROL_HO | MAC_CONTROL_HP); | 316 | MAC_CONTROL_HO | MAC_CONTROL_HP); |
317 | } else { | 317 | } else { |
318 | u32 mc_filter[2]; | 318 | u32 mc_filter[2]; |
319 | struct dev_mc_list *mclist; | 319 | struct netdev_hw_addr *ha; |
320 | 320 | ||
321 | /* Perfect filter mode for physical address and Hash | 321 | /* Perfect filter mode for physical address and Hash |
322 | filter for multicast */ | 322 | filter for multicast */ |
@@ -325,11 +325,11 @@ static void dwmac100_set_filter(struct net_device *dev) | |||
325 | MAC_CONTROL_IF | MAC_CONTROL_HO); | 325 | MAC_CONTROL_IF | MAC_CONTROL_HO); |
326 | 326 | ||
327 | memset(mc_filter, 0, sizeof(mc_filter)); | 327 | memset(mc_filter, 0, sizeof(mc_filter)); |
328 | netdev_for_each_mc_addr(mclist, dev) { | 328 | netdev_for_each_mc_addr(ha, dev) { |
329 | /* The upper 6 bits of the calculated CRC are used to | 329 | /* The upper 6 bits of the calculated CRC are used to |
330 | * index the contens of the hash table */ | 330 | * index the contens of the hash table */ |
331 | int bit_nr = | 331 | int bit_nr = |
332 | ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; | 332 | ether_crc(ETH_ALEN, ha->addr) >> 26; |
333 | /* The most significant bit determines the register to | 333 | /* The most significant bit determines the register to |
334 | * use (H/L) while the other 5 bits determine the bit | 334 | * use (H/L) while the other 5 bits determine the bit |
335 | * within the register. */ | 335 | * within the register. */ |
diff --git a/drivers/net/stmmac/dwmac1000_core.c b/drivers/net/stmmac/dwmac1000_core.c index a6538ae4694c..bf73fda6adfb 100644 --- a/drivers/net/stmmac/dwmac1000_core.c +++ b/drivers/net/stmmac/dwmac1000_core.c | |||
@@ -94,17 +94,17 @@ static void dwmac1000_set_filter(struct net_device *dev) | |||
94 | writel(0xffffffff, ioaddr + GMAC_HASH_LOW); | 94 | writel(0xffffffff, ioaddr + GMAC_HASH_LOW); |
95 | } else if (!netdev_mc_empty(dev)) { | 95 | } else if (!netdev_mc_empty(dev)) { |
96 | u32 mc_filter[2]; | 96 | u32 mc_filter[2]; |
97 | struct dev_mc_list *mclist; | 97 | struct netdev_hw_addr *ha; |
98 | 98 | ||
99 | /* Hash filter for multicast */ | 99 | /* Hash filter for multicast */ |
100 | value = GMAC_FRAME_FILTER_HMC; | 100 | value = GMAC_FRAME_FILTER_HMC; |
101 | 101 | ||
102 | memset(mc_filter, 0, sizeof(mc_filter)); | 102 | memset(mc_filter, 0, sizeof(mc_filter)); |
103 | netdev_for_each_mc_addr(mclist, dev) { | 103 | netdev_for_each_mc_addr(ha, dev) { |
104 | /* The upper 6 bits of the calculated CRC are used to | 104 | /* The upper 6 bits of the calculated CRC are used to |
105 | index the contens of the hash table */ | 105 | index the contens of the hash table */ |
106 | int bit_nr = | 106 | int bit_nr = |
107 | bitrev32(~crc32_le(~0, mclist->dmi_addr, 6)) >> 26; | 107 | bitrev32(~crc32_le(~0, ha->addr, 6)) >> 26; |
108 | /* The most significant bit determines the register to | 108 | /* The most significant bit determines the register to |
109 | * use (H/L) while the other 5 bits determine the bit | 109 | * use (H/L) while the other 5 bits determine the bit |
110 | * within the register. */ | 110 | * within the register. */ |
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index a6733612d64a..963f591f1e0e 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
@@ -836,7 +836,7 @@ static int stmmac_open(struct net_device *dev) | |||
836 | #ifdef CONFIG_STMMAC_TIMER | 836 | #ifdef CONFIG_STMMAC_TIMER |
837 | priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL); | 837 | priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL); |
838 | if (unlikely(priv->tm == NULL)) { | 838 | if (unlikely(priv->tm == NULL)) { |
839 | pr_err("%s: ERROR: timer memory alloc failed \n", __func__); | 839 | pr_err("%s: ERROR: timer memory alloc failed\n", __func__); |
840 | return -ENOMEM; | 840 | return -ENOMEM; |
841 | } | 841 | } |
842 | priv->tm->freq = tmrate; | 842 | priv->tm->freq = tmrate; |
@@ -1685,8 +1685,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev) | |||
1685 | } | 1685 | } |
1686 | pr_info("done!\n"); | 1686 | pr_info("done!\n"); |
1687 | 1687 | ||
1688 | if (!request_mem_region(res->start, (res->end - res->start), | 1688 | if (!request_mem_region(res->start, resource_size(res), pdev->name)) { |
1689 | pdev->name)) { | ||
1690 | pr_err("%s: ERROR: memory allocation failed" | 1689 | pr_err("%s: ERROR: memory allocation failed" |
1691 | "cannot get the I/O addr 0x%x\n", | 1690 | "cannot get the I/O addr 0x%x\n", |
1692 | __func__, (unsigned int)res->start); | 1691 | __func__, (unsigned int)res->start); |
@@ -1694,9 +1693,9 @@ static int stmmac_dvr_probe(struct platform_device *pdev) | |||
1694 | goto out; | 1693 | goto out; |
1695 | } | 1694 | } |
1696 | 1695 | ||
1697 | addr = ioremap(res->start, (res->end - res->start)); | 1696 | addr = ioremap(res->start, resource_size(res)); |
1698 | if (!addr) { | 1697 | if (!addr) { |
1699 | pr_err("%s: ERROR: memory mapping failed \n", __func__); | 1698 | pr_err("%s: ERROR: memory mapping failed\n", __func__); |
1700 | ret = -ENOMEM; | 1699 | ret = -ENOMEM; |
1701 | goto out; | 1700 | goto out; |
1702 | } | 1701 | } |
@@ -1774,7 +1773,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev) | |||
1774 | out: | 1773 | out: |
1775 | if (ret < 0) { | 1774 | if (ret < 0) { |
1776 | platform_set_drvdata(pdev, NULL); | 1775 | platform_set_drvdata(pdev, NULL); |
1777 | release_mem_region(res->start, (res->end - res->start)); | 1776 | release_mem_region(res->start, resource_size(res)); |
1778 | if (addr != NULL) | 1777 | if (addr != NULL) |
1779 | iounmap(addr); | 1778 | iounmap(addr); |
1780 | } | 1779 | } |
@@ -1812,7 +1811,7 @@ static int stmmac_dvr_remove(struct platform_device *pdev) | |||
1812 | 1811 | ||
1813 | iounmap((void *)ndev->base_addr); | 1812 | iounmap((void *)ndev->base_addr); |
1814 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1813 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1815 | release_mem_region(res->start, (res->end - res->start)); | 1814 | release_mem_region(res->start, resource_size(res)); |
1816 | 1815 | ||
1817 | free_netdev(ndev); | 1816 | free_netdev(ndev); |
1818 | 1817 | ||