ocpbus(4)
M. Warner Losh
imp at bsdimp.com
Fri Dec 28 17:04:13 PST 2007
In message: <20071228.163257.756911359.imp at bsdimp.com>
"M. Warner Losh" <imp at bsdimp.com> writes:
: No, this is more or less the gist of it. The type and id
: can be chosen in any way we like, including using the type
: as the id.
I just went out to shovel the drive way (a hazard of living in
Colorado) and the above stuck in my head. One could also make the
type/id a string and then the probe routines become something like:
static int
at91_ssc_probe(device_t dev)
{
if (strcmpy(device_get_name(dev), ocpbus_get_devname(dev)) != 0)
return (ENXIO);
device_set_descr(dev, "SSC");
return (0); /* or some other negative value */
}
without the need to have the actual enumeration... This would be more
complicated than setting the name when the child was added, but it
would have the advantage of being overrideable if necessary.
I'm just worried that the file defining an enum would soon become a
big source of integration failures when code designed for these
devices is integrated back into the tree. Maintaining big lists in
the tree is something that newbus was designed to avoid. The
artificial IDs seem to be reintroducing that, which is why I've had
the negative reaction that I've had to it.
Warner
More information about the freebsd-embedded
mailing list