diff options
Diffstat (limited to 'drivers/net/ethoc.c')
-rw-r--r-- | drivers/net/ethoc.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 1681f081ff6f..37ce8aca2cc6 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c | |||
@@ -964,7 +964,7 @@ static int ethoc_probe(struct platform_device *pdev) | |||
964 | } | 964 | } |
965 | } else { | 965 | } else { |
966 | /* Allocate buffer memory */ | 966 | /* Allocate buffer memory */ |
967 | priv->membase = dma_alloc_coherent(NULL, | 967 | priv->membase = dmam_alloc_coherent(&pdev->dev, |
968 | buffer_size, (void *)&netdev->mem_start, | 968 | buffer_size, (void *)&netdev->mem_start, |
969 | GFP_KERNEL); | 969 | GFP_KERNEL); |
970 | if (!priv->membase) { | 970 | if (!priv->membase) { |
@@ -1074,21 +1074,6 @@ free_mdio: | |||
1074 | kfree(priv->mdio->irq); | 1074 | kfree(priv->mdio->irq); |
1075 | mdiobus_free(priv->mdio); | 1075 | mdiobus_free(priv->mdio); |
1076 | free: | 1076 | free: |
1077 | if (priv) { | ||
1078 | if (priv->dma_alloc) | ||
1079 | dma_free_coherent(NULL, priv->dma_alloc, priv->membase, | ||
1080 | netdev->mem_start); | ||
1081 | else if (priv->membase) | ||
1082 | devm_iounmap(&pdev->dev, priv->membase); | ||
1083 | if (priv->iobase) | ||
1084 | devm_iounmap(&pdev->dev, priv->iobase); | ||
1085 | } | ||
1086 | if (mem) | ||
1087 | devm_release_mem_region(&pdev->dev, mem->start, | ||
1088 | mem->end - mem->start + 1); | ||
1089 | if (mmio) | ||
1090 | devm_release_mem_region(&pdev->dev, mmio->start, | ||
1091 | mmio->end - mmio->start + 1); | ||
1092 | free_netdev(netdev); | 1077 | free_netdev(netdev); |
1093 | out: | 1078 | out: |
1094 | return ret; | 1079 | return ret; |
@@ -1115,17 +1100,6 @@ static int ethoc_remove(struct platform_device *pdev) | |||
1115 | kfree(priv->mdio->irq); | 1100 | kfree(priv->mdio->irq); |
1116 | mdiobus_free(priv->mdio); | 1101 | mdiobus_free(priv->mdio); |
1117 | } | 1102 | } |
1118 | if (priv->dma_alloc) | ||
1119 | dma_free_coherent(NULL, priv->dma_alloc, priv->membase, | ||
1120 | netdev->mem_start); | ||
1121 | else { | ||
1122 | devm_iounmap(&pdev->dev, priv->membase); | ||
1123 | devm_release_mem_region(&pdev->dev, netdev->mem_start, | ||
1124 | netdev->mem_end - netdev->mem_start + 1); | ||
1125 | } | ||
1126 | devm_iounmap(&pdev->dev, priv->iobase); | ||
1127 | devm_release_mem_region(&pdev->dev, netdev->base_addr, | ||
1128 | priv->io_region_size); | ||
1129 | unregister_netdev(netdev); | 1103 | unregister_netdev(netdev); |
1130 | free_netdev(netdev); | 1104 | free_netdev(netdev); |
1131 | } | 1105 | } |