[RFC/PATCH 2/3] of: add of_lookup_stdout() utility function

David Miller davem at davemloft.net
Wed Aug 6 20:52:05 EST 2008


From: Paul Mackerras <paulus at samba.org>
Date: Wed, 6 Aug 2008 20:21:04 +1000

> David Miller writes:
> 
> > On sparc platforms this is obtained differently.  We obtain the 32-bit
> > instance value of "/chosen/stdout" and convert that into a prom device
> > node path using "instance-to-path".
> 
> That's actually exactly what we do too, the linux,stdout-path property
> is just a cache of the result of that process.  The difference is that
> we have to do it early on while we still have OF around, while you can
> do it later.

I do it right when I build the in-kernel OBP tree.  Then I cache
these results in:

extern struct device_node *of_console_device;
extern char *of_console_path;
extern char *of_console_options;

which are declared in asm/prom.h

I could compute it even earlier and just store a phandle instead
of a device_node pointer.



More information about the Linuxppc-dev mailing list