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>
This commit is contained in:

committed by
David S. Miller

parent
0d0d9c150c
commit
976de6a8c3
@@ -43,6 +43,10 @@
|
||||
#include <asm/commproc.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC_CPM_NEW_BINDING
|
||||
#include <asm/of_device.h>
|
||||
#endif
|
||||
|
||||
#include "fs_enet.h"
|
||||
#include "fec.h"
|
||||
|
||||
@@ -95,6 +99,19 @@ static int whack_reset(fec_t * fecp)
|
||||
|
||||
static int do_pd_setup(struct fs_enet_private *fep)
|
||||
{
|
||||
#ifdef CONFIG_PPC_CPM_NEW_BINDING
|
||||
struct of_device *ofdev = to_of_device(fep->dev);
|
||||
|
||||
fep->interrupt = of_irq_to_resource(ofdev->node, 0, NULL);
|
||||
if (fep->interrupt == NO_IRQ)
|
||||
return -EINVAL;
|
||||
|
||||
fep->fec.fecp = of_iomap(ofdev->node, 0);
|
||||
if (!fep->fcc.fccp)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
#else
|
||||
struct platform_device *pdev = to_platform_device(fep->dev);
|
||||
struct resource *r;
|
||||
|
||||
@@ -110,7 +127,7 @@ static int do_pd_setup(struct fs_enet_private *fep)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#define FEC_NAPI_RX_EVENT_MSK (FEC_ENET_RXF | FEC_ENET_RXB)
|
||||
|
Reference in New Issue
Block a user