diff options
author | Scott Wood <scottwood@freescale.com> | 2007-10-02 11:55:58 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:54:03 -0400 |
commit | 976de6a8c304dcc43e38efcb8a0bace7866b6242 (patch) | |
tree | bae132693bbcfa65c03cf44c7db924fdebf13158 /drivers/net/fs_enet/mac-fec.c | |
parent | 0d0d9c150c046cbd3e507adcfa2d78db82f1f452 (diff) |
fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.
The existing OF glue code was crufty and broken. Rather than fix it, it
will be removed, and the ethernet driver now talks to the device tree
directly.
The old, non-CONFIG_PPC_CPM_NEW_BINDING code can go away once CPM
platforms are dropped from arch/ppc (which will hopefully be soon), and
existing arch/powerpc boards that I wasn't able to test on for this
patchset get converted (which should be even sooner).
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
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) |