summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorguoyin.chen <guoyin.chen@freescale.com>2013-07-15 15:01:21 +0800
committerguoyin.chen <guoyin.chen@freescale.com>2013-07-15 15:01:21 +0800
commit5793da66dd82a437c23d4a833674c0e09bd1aa07 (patch)
tree2f34bdc95dedb46d2a91d12837e58b1cf3a3e33f /drivers/net
parentf128c5660150679f00e518da8e3f582e9a2f03a8 (diff)
parent9e268cc3e4386f1a5a31a62f7207e5a9b8420124 (diff)
Merge remote-tracking branch 'fsl-linux-sdk/imx_3.0.35_4.1.0' into imx_3.0.35_android
Conflicts: arch/arm/mach-mx6/Kconfig arch/arm/mach-mx6/board-mx6q_arm2.c arch/arm/mach-mx6/board-mx6q_arm2.h arch/arm/mach-mx6/board-mx6q_hdmidongle.c arch/arm/mach-mx6/board-mx6q_sabreauto.c arch/arm/mach-mx6/board-mx6q_sabreauto.h arch/arm/mach-mx6/board-mx6q_sabrelite.c arch/arm/mach-mx6/board-mx6q_sabresd.c arch/arm/mach-mx6/board-mx6q_sabresd.h arch/arm/mach-mx6/clock.c arch/arm/mach-mx6/pcie.c arch/arm/plat-mxc/include/mach/iomux-mx6q.h arch/arm/plat-mxc/include/mach/pcie.h drivers/dma/imx-sdma.c drivers/input/touchscreen/egalax_ts.c drivers/media/video/mxc/capture/csi_v4l2_capture.c drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c drivers/mxc/mlb/mxc_mlb150.c drivers/mxc/thermal/thermal.c drivers/net/fec.c drivers/usb/host/ehci-arc.c drivers/video/mxc/mxc_ipuv3_fb.c include/linux/fec.h sound/soc/imx/imx-wm8962.c
Diffstat (limited to 'drivers/net')
-rwxr-xr-xdrivers/net/fec.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index ebb09eb9a6f2..d2fea018f927 100755
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -636,7 +636,7 @@ static int fec_rx_poll(struct napi_struct *napi, int budget)
data = (__u8 *)__va(bdp->cbd_bufaddr);
if (bdp->cbd_bufaddr)
- dma_unmap_single(&ndev->dev, bdp->cbd_bufaddr,
+ dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr,
FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE);
if (id_entry->driver_data & FEC_QUIRK_SWAP_FRAME)
@@ -664,7 +664,7 @@ static int fec_rx_poll(struct napi_struct *napi, int budget)
netif_receive_skb(skb);
}
- bdp->cbd_bufaddr = dma_map_single(&ndev->dev, data,
+ bdp->cbd_bufaddr = dma_map_single(&fep->pdev->dev, data,
FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE);
rx_processing_done:
/* Clear the status flags for this buffer */
@@ -1873,32 +1873,33 @@ fec_probe(struct platform_device *pdev)
if (pdata)
fep->phy_interface = pdata->phy;
-#ifdef CONFIG_MX6_ENET_IRQ_TO_GPIO
- gpio_request(pdata->gpio_irq, "gpio_enet_irq");
- gpio_direction_input(pdata->gpio_irq);
+ if (pdata->gpio_irq < 0) {
+ gpio_request(pdata->gpio_irq, "gpio_enet_irq");
+ gpio_direction_input(pdata->gpio_irq);
- irq = gpio_to_irq(pdata->gpio_irq);
- ret = request_irq(irq, fec_enet_interrupt,
- IRQF_TRIGGER_RISING,
- pdev->name, ndev);
- if (ret)
- goto failed_irq;
-#else
- /* This device has up to three irqs on some platforms */
- for (i = 0; i < 3; i++) {
- irq = platform_get_irq(pdev, i);
- if (i && irq < 0)
- break;
- ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev);
- if (ret) {
- while (--i >= 0) {
- irq = platform_get_irq(pdev, i);
- free_irq(irq, ndev);
- }
+ irq = gpio_to_irq(pdata->gpio_irq);
+ ret = request_irq(irq, fec_enet_interrupt,
+ IRQF_TRIGGER_RISING,
+ pdev->name, ndev);
+ if (ret)
goto failed_irq;
+ } else {
+ /* This device has up to three irqs on some platforms */
+ for (i = 0; i < 3; i++) {
+ irq = platform_get_irq(pdev, i);
+ if (i && irq < 0)
+ break;
+ ret = request_irq(irq, fec_enet_interrupt,
+ IRQF_DISABLED, pdev->name, ndev);
+ if (ret) {
+ while (--i >= 0) {
+ irq = platform_get_irq(pdev, i);
+ free_irq(irq, ndev);
+ }
+ goto failed_irq;
+ }
}
}
-#endif
fep->clk = clk_get(&pdev->dev, "fec_clk");
if (IS_ERR(fep->clk)) {
@@ -1949,15 +1950,15 @@ failed_init:
clk_disable(fep->clk);
clk_put(fep->clk);
failed_clk:
-#ifdef CONFIG_MX6_ENET_IRQ_TO_GPIO
- free_irq(irq, ndev);
-#else
- for (i = 0; i < 3; i++) {
- irq = platform_get_irq(pdev, i);
- if (irq > 0)
- free_irq(irq, ndev);
+ if (pdata->gpio_irq < 0)
+ free_irq(irq, ndev);
+ else {
+ for (i = 0; i < 3; i++) {
+ irq = platform_get_irq(pdev, i);
+ if (irq > 0)
+ free_irq(irq, ndev);
+ }
}
-#endif
failed_irq:
iounmap(fep->hwp);
failed_ioremap: