aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/smc91x.c
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2008-06-24 03:36:05 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-07-12 16:52:41 -0400
commit52256c0e06e4a4df67134b951a21b50c713a9588 (patch)
tree6e003932a594d85cb8bcbc880d5fc12d25faf8a6 /drivers/net/smc91x.c
parent159198862adad7109bb347bb30a620f67beac45f (diff)
[NET] smc91x: prepare SMC_USE_PXA_DMA to be specified in platform data
Now that the original SMC_USE_PXA_DMA specific code will always being built if CONFIG_ARCH_PXA is defined, so to make this part of the code to be PXA public, and still prevent it from being built if support of PXA is not selected. A SMC91X_USE_DMA flag is added to the platform data to allow platform to choose its usage of DMA. Note this flag itself is so named to be generic enough (assuming other platforms can also use DMA). It keeps backward compatibility to set the SMC91X_USE_DMA flag if SMC_USE_PXA_DMA is still defined. Signed-off-by: Eric Miao <eric.miao@marvell.com> Acked-by: Nicolas Pitre <nico@cam.org> Acked-by: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/net/smc91x.c')
-rw-r--r--drivers/net/smc91x.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 34bfc60e8074..2040965d7724 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -1939,8 +1939,11 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
1939 if (retval) 1939 if (retval)
1940 goto err_out; 1940 goto err_out;
1941 1941
1942#ifdef SMC_USE_PXA_DMA 1942#ifdef CONFIG_ARCH_PXA
1943 { 1943# ifdef SMC_USE_PXA_DMA
1944 lp->cfg.flags |= SMC91X_USE_DMA;
1945# endif
1946 if (lp->cfg.flags & SMC91X_USE_DMA) {
1944 int dma = pxa_request_dma(dev->name, DMA_PRIO_LOW, 1947 int dma = pxa_request_dma(dev->name, DMA_PRIO_LOW,
1945 smc_pxa_dma_irq, NULL); 1948 smc_pxa_dma_irq, NULL);
1946 if (dma >= 0) 1949 if (dma >= 0)
@@ -1980,7 +1983,7 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
1980 } 1983 }
1981 1984
1982err_out: 1985err_out:
1983#ifdef SMC_USE_PXA_DMA 1986#ifdef CONFIG_ARCH_PXA
1984 if (retval && dev->dma != (unsigned char)-1) 1987 if (retval && dev->dma != (unsigned char)-1)
1985 pxa_free_dma(dev->dma); 1988 pxa_free_dma(dev->dma);
1986#endif 1989#endif
@@ -2198,7 +2201,7 @@ static int smc_drv_probe(struct platform_device *pdev)
2198 goto out_release_attrib; 2201 goto out_release_attrib;
2199 } 2202 }
2200 2203
2201#ifdef SMC_USE_PXA_DMA 2204#ifdef CONFIG_ARCH_PXA
2202 { 2205 {
2203 struct smc_local *lp = netdev_priv(ndev); 2206 struct smc_local *lp = netdev_priv(ndev);
2204 lp->device = &pdev->dev; 2207 lp->device = &pdev->dev;
@@ -2241,7 +2244,7 @@ static int smc_drv_remove(struct platform_device *pdev)
2241 2244
2242 free_irq(ndev->irq, ndev); 2245 free_irq(ndev->irq, ndev);
2243 2246
2244#ifdef SMC_USE_PXA_DMA 2247#ifdef CONFIG_ARCH_PXA
2245 if (ndev->dma != (unsigned char)-1) 2248 if (ndev->dma != (unsigned char)-1)
2246 pxa_free_dma(ndev->dma); 2249 pxa_free_dma(ndev->dma);
2247#endif 2250#endif