On Wed, Sep 12, 2012 at 12:17 AM, Peter Crosthwaite <peter.crosthwa...@petalogix.com> wrote: > On Tue, 2012-09-11 at 19:27 +0000, Blue Swirl wrote: >> On Mon, Sep 10, 2012 at 12:20 AM, <crwu...@gmail.com> wrote: >> > From: Chris Wulff <crwu...@gmail.com> >> > >> > +/* >> > + * Xilinx ethernetlite device >> > + */ >> > +static void xilinx_ethlite_probe(void *fdt, int node) >> > +{ >> > + uint32_t eth_addr = fdt_get_int_from_array(fdt, node, "reg", 0); >> > + uint32_t eth_irq = fdt_get_int_from_array(fdt, node, "interrupts", 0); >> > + >> > + xilinx_ethlite_create(&nd_table[++eth_dev_index], eth_addr, >> > + irq[eth_irq], 0, 0); >> >> The device should not access nd_table, this should be handled at board level. >> > > This is board level isn't it? This function calls > xilinx_ethlite_create() which in turn does the qdev_create so this is > pre device creation. Im open to suggestions on how to do this in a > non-global hacking way however as I have the same problem in my tree.
OK, the device code is mixed with the board code and that was confusing me. It could be better to move the device part to a separate file. > > Regards, > Peter > >> > +} >> > + >> > +devinfo_t xilinx_ethlite_device = { >> > + .probe = &xilinx_ethlite_probe, >> > + .pass = 1, >> > + .compat = (const char * []) { "xlnx,xps-ethernetlite-2.00.b", NULL } >> > +}; >> > + > >