diff options
Diffstat (limited to 'drivers/net/fs_enet/mac-fec.c')
-rw-r--r-- | drivers/net/fs_enet/mac-fec.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c index cbdc17b743db..924d6617cd30 100644 --- a/drivers/net/fs_enet/mac-fec.c +++ b/drivers/net/fs_enet/mac-fec.c | |||
@@ -43,6 +43,10 @@ | |||
43 | #include <asm/commproc.h> | 43 | #include <asm/commproc.h> |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | #ifdef CONFIG_PPC_CPM_NEW_BINDING | ||
47 | #include <asm/of_device.h> | ||
48 | #endif | ||
49 | |||
46 | #include "fs_enet.h" | 50 | #include "fs_enet.h" |
47 | #include "fec.h" | 51 | #include "fec.h" |
48 | 52 | ||
@@ -95,6 +99,19 @@ static int whack_reset(fec_t * fecp) | |||
95 | 99 | ||
96 | static int do_pd_setup(struct fs_enet_private *fep) | 100 | static int do_pd_setup(struct fs_enet_private *fep) |
97 | { | 101 | { |
102 | #ifdef CONFIG_PPC_CPM_NEW_BINDING | ||
103 | struct of_device *ofdev = to_of_device(fep->dev); | ||
104 | |||
105 | fep->interrupt = of_irq_to_resource(ofdev->node, 0, NULL); | ||
106 | if (fep->interrupt == NO_IRQ) | ||
107 | return -EINVAL; | ||
108 | |||
109 | fep->fec.fecp = of_iomap(ofdev->node, 0); | ||
110 | if (!fep->fcc.fccp) | ||
111 | return -EINVAL; | ||
112 | |||
113 | return 0; | ||
114 | #else | ||
98 | struct platform_device *pdev = to_platform_device(fep->dev); | 115 | struct platform_device *pdev = to_platform_device(fep->dev); |
99 | struct resource *r; | 116 | struct resource *r; |
100 | 117 | ||
@@ -110,7 +127,7 @@ static int do_pd_setup(struct fs_enet_private *fep) | |||
110 | return -EINVAL; | 127 | return -EINVAL; |
111 | 128 | ||
112 | return 0; | 129 | return 0; |
113 | 130 | #endif | |
114 | } | 131 | } |
115 | 132 | ||
116 | #define FEC_NAPI_RX_EVENT_MSK (FEC_ENET_RXF | FEC_ENET_RXB) | 133 | #define FEC_NAPI_RX_EVENT_MSK (FEC_ENET_RXF | FEC_ENET_RXB) |