Subject: Re: Separating softc and struct device?
To: None <tech-kern@netbsd.org>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 08/29/2007 22:34:41
--nfnKjHknX58/oBIK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 29, 2007 at 10:22:20PM +0200, Joerg Sonnenberger wrote:
> Hi all,
> is there a good reason to keep all the pointer casts for
> device softc's to struct device and vice versa? I think it would be good
> to follow the changes in ifnet vs arpcom and use direct pointer.
> An additional goody would be that struct device could become an abstract
> type and modifying it gets easier.
>=20
> Opinions?

It's my mid-term plan.  My laptop has been running that way for quite a
while now.

It's not just about casts.  There are several reasons it is needed:

 - a device_t should be created whether or not a driver attach
   (corollary:  a driver can attach later)
 - parent can get a device_t object, set some properties, _then_ let a
   driver attach

--=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.

--nfnKjHknX58/oBIK
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iQEVAwUBRtXYYdgoQloHrPnoAQJAHggAxLYhF0RzyNWsX6e3q2o1MfSiVfOnKyXd
h71FipNo+e8YYTLuxLV0qh2KYQHqa49p3FCsRqHG/JHWTVjEb67cGiwQd7W7IBge
YgQjG7nKmqhJ4Mouw6Fvgxwyg2A8QU3028hrluNf12AVbyoAxmWu7vz82Pm3HVz6
FzR/tOfLV4Vn5O2R+qEVLHb11r0tM7vO5pYDYA8fPT+PLzspEsBf7oJRbal93lgE
qh/OI6HFhJ/nHGCOXrRv2U/eaOlvNLI5cO77ukLhR/5i2T8VcuNE3s3N8lpH3tng
P1EJbRvIghDy1bRaewNuQFcEi7f7Jwcnt1g6NXFvIh7WNQCln+35wQ==
=UzOq
-----END PGP SIGNATURE-----

--nfnKjHknX58/oBIK--