diff options
Diffstat (limited to 'drivers/net/stmmac/stmmac_main.c')
-rw-r--r-- | drivers/net/stmmac/stmmac_main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index a6733612d64a..4111a85ec80e 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/phy.h> | 44 | #include <linux/phy.h> |
45 | #include <linux/if_vlan.h> | 45 | #include <linux/if_vlan.h> |
46 | #include <linux/dma-mapping.h> | 46 | #include <linux/dma-mapping.h> |
47 | #include <linux/slab.h> | ||
47 | #include "stmmac.h" | 48 | #include "stmmac.h" |
48 | 49 | ||
49 | #define STMMAC_RESOURCE_NAME "stmmaceth" | 50 | #define STMMAC_RESOURCE_NAME "stmmaceth" |
@@ -1685,7 +1686,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev) | |||
1685 | } | 1686 | } |
1686 | pr_info("done!\n"); | 1687 | pr_info("done!\n"); |
1687 | 1688 | ||
1688 | if (!request_mem_region(res->start, (res->end - res->start), | 1689 | if (!request_mem_region(res->start, resource_size(res), |
1689 | pdev->name)) { | 1690 | pdev->name)) { |
1690 | pr_err("%s: ERROR: memory allocation failed" | 1691 | pr_err("%s: ERROR: memory allocation failed" |
1691 | "cannot get the I/O addr 0x%x\n", | 1692 | "cannot get the I/O addr 0x%x\n", |
@@ -1694,9 +1695,9 @@ static int stmmac_dvr_probe(struct platform_device *pdev) | |||
1694 | goto out; | 1695 | goto out; |
1695 | } | 1696 | } |
1696 | 1697 | ||
1697 | addr = ioremap(res->start, (res->end - res->start)); | 1698 | addr = ioremap(res->start, resource_size(res)); |
1698 | if (!addr) { | 1699 | if (!addr) { |
1699 | pr_err("%s: ERROR: memory mapping failed \n", __func__); | 1700 | pr_err("%s: ERROR: memory mapping failed\n", __func__); |
1700 | ret = -ENOMEM; | 1701 | ret = -ENOMEM; |
1701 | goto out; | 1702 | goto out; |
1702 | } | 1703 | } |
@@ -1774,7 +1775,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev) | |||
1774 | out: | 1775 | out: |
1775 | if (ret < 0) { | 1776 | if (ret < 0) { |
1776 | platform_set_drvdata(pdev, NULL); | 1777 | platform_set_drvdata(pdev, NULL); |
1777 | release_mem_region(res->start, (res->end - res->start)); | 1778 | release_mem_region(res->start, resource_size(res)); |
1778 | if (addr != NULL) | 1779 | if (addr != NULL) |
1779 | iounmap(addr); | 1780 | iounmap(addr); |
1780 | } | 1781 | } |
@@ -1812,7 +1813,7 @@ static int stmmac_dvr_remove(struct platform_device *pdev) | |||
1812 | 1813 | ||
1813 | iounmap((void *)ndev->base_addr); | 1814 | iounmap((void *)ndev->base_addr); |
1814 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1815 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1815 | release_mem_region(res->start, (res->end - res->start)); | 1816 | release_mem_region(res->start, resource_size(res)); |
1816 | 1817 | ||
1817 | free_netdev(ndev); | 1818 | free_netdev(ndev); |
1818 | 1819 | ||