Subject: Re: How to get the firmware node into the device properties early?
To: Jachym Holecek <freza@dspfpga.com>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 09/13/2006 14:52:44
--YZQs1kEQY307C4ut
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 13, 2006 at 02:13:05PM +0200, Jachym Holecek wrote:
> # Quentin Garnier 2006-09-13:
> > On Wed, Sep 13, 2006 at 01:21:01PM +0200, Jachym Holecek wrote:
> > > # Martin Husemann 2006-09-12:
> > > > I am looking for an easy way to retrieve the OpenFirmware node (pha=
ndle)
> > > > of a struct device * I get passed in device_register(). Is there an=
y magic
> > > > way to store them in the device properties early?
> > >=20
> > > Not that I'm aware of (besides something like you posted).
> > >=20
> > > Maybe early MD code should be allowed to precreate device_t nodes
> > > and let autoconfiguration proccess use them instead of creating
> > > fresh ones. But this is kind of forward-thought, there's quite a
> > > couple of things in our autoconf machinery that need to change
> > > "device_t =3D=3D ${foo}softc" being the most evil.
> >=20
> > Ahem.  Not evil.  Intrusive, perhaps, but definitely not evil.
>=20
> OK, my wording was too strong. I really meant "not nice" to the point
> that it makes other good things harder/uglier than they should be.

We could very well introduce some kind of config_alloc_child to get a
device_t.  config_found and related don't have to change.

Sure, that means all the casts from struct device * to struct mysoftc *
have to be changed to some kind of device_get_softc.  Between the two,
I'm honestly not sure which is the less ugly.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"You could have made it, spitting out benchmarks
Owe it to yourself not to fail"
Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.

--YZQs1kEQY307C4ut
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)

iQEVAwUBRQf/HNgoQloHrPnoAQJ7MQf9Ezs3NVTAI2QHD1lwaiKK4/wIFZ55TIKk
gLEPuPfPayQciorjJ3Xz9f/g6r9dSmpJT2ltIjOeljbEKo8wS7IxCrpcZwQ8gRXN
CgNikIGNaQb+zOlrIY9GXrWCFL587BUYkaAsoSc6yQi+Toy/WXovkYZqvAO2v64D
Q9yAdfNusCav0tG3hK5RqzzzdLp2USJVbiyXcUAEV1hkaHm3vVLghTmXjZ9kqPOM
oZDmSBIlxb8tQcU2AJi8OxxovF3sAfETFW5DXUx4s2cDHlEh6ad9HBMmLNNR0ymj
sktV9FbVXoCTusBU83vqHLLQCKrQcSEx6475zPaDMMYEXjI5pg+O8Q==
=nh7v
-----END PGP SIGNATURE-----

--YZQs1kEQY307C4ut--