Subject: Re: How to get the firmware node into the device properties early?
To: Martin Husemann <firstname.lastname@example.org>
From: Eduardo Horvath <eeh@NetBSD.org>
Date: 09/14/2006 15:59:16
On Wed, 13 Sep 2006, Martin Husemann wrote:
> On Wed, Sep 13, 2006 at 03:43:39PM +0000, Eduardo Horvath wrote:
> > The trick, of course, is to get the device's phandle associated
> > with its device node.
> Yes, I'm exactly at this point.
> I'm not sure I'll go the ihandle>phandle way that you suggested (quite some
> time ago) or use OF_package_to_path to do it the other way around - for exact
> matches (like network devices) it does not realy matter, but for scsi/atapi
> devices (with additional knowledge about the location on the scsipi bus
> already available) it allows easier matching, IMHO.
If you do ihandle>phandle you don't need to do any string parsing. Just
check the device_type property, then for disk devices you can get the
device's address directly from my-unit. The only bit you may need to do
parsing to extract from either the path or my-args is the partition name.