Subject: Re: GPIO on the Soekris net4801
To: Jaromir Dolecek <jdolecek@NetBSD.org>
From: Quentin Garnier <cube@cubidou.net>
List: current-users
Date: 10/16/2005 11:41:21
--31zvzas5NXT9fief
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Oct 16, 2005 at 10:45:37AM +0200, Jaromir Dolecek wrote:
[...]
> However, this is somewhat weird in gscpcib.c:
>=20
> corepcib:
> #endif  /* !SMALL_KERNEL */
>         /* Provide core pcib(4) functionality */
>         pcibattach(parent, self, aux);
>=20
> #ifndef SMALL_KERNEL
>         /* Attach GPIO framework */
>         if (gpio_present)
>                 config_found_ia(&sc->sc_dev, "gpiobus", &gba, gpiobus_pri=
nt);
> #endif  /* !SMALL_KERNEL */
>=20
>=20
> That looks as if the gpio attach uses same device structure as
> the pcib, i.e. gpio attach overwrites the structure. Couldn't that be
> the problem?

"self" and "&sc->sc_dev" are two ways of writing the same thing, and
it is passed as the parent device to config_found_ia.

pcib(4) attachment only uses a struct device, so there is no conflict
here.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--31zvzas5NXT9fief
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iQEVAwUBQ1IgQdgoQloHrPnoAQJJPgf/cN4XK3j9h0HP9qgwi8NaNo+r5I2V3W1E
dPwheZpQsUuwTlrT9v6r8MaZQiZH1SB8XbCB3ZB4oQevuq/ZeK15S6WZYy4L3Swe
dKLCdu9AOg/9vHPWjiofAkpl1onzpk6UMczUccN3cZpCr87X3oBSsfjv/ZbvKwFl
2Edii0YZDlbQfC03wAY/OxVIObIWtOETAZloJNTBxCZYqKLKqIrCsRp1PHzg33MX
5hCHhUwmYiBk7MKq6LvqwPL3HkbqWCTaltshQobPN/WifXyHExwcrVTjcpKOAspw
IECgW0W4qsNLruzgxdnXYGbxQnvSJaE6fC+d/ZgIgpZNgKQ+VxX4CA==
=XWuM
-----END PGP SIGNATURE-----

--31zvzas5NXT9fief--