Subject: Re: How to get the firmware node into the device properties early?
To: Quentin Garnier <>
From: Jachym Holecek <>
List: tech-kern
Date: 09/13/2006 15:21:21
# Quentin Garnier 2006-09-13:
> 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.

I'm not sure I understand here. Calling convention of config_found()
and friends wouldn't have to change, but their implementation would
need to be tought that some devices have already been created before
autoconf started.

Now, mapping existing (created before autoconf) devices to instances
found during autoconf could be somewhat tricky. Off the top of my
head, I don't know how to do that except for a device_register()-like
MD hook...

But well, this is just an immediate idea, not something I though about

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

We already have (and use at some places) device_private(). This
returns a "void *" so you can avoid an explicit cast (which is
arguably a small win compared to status quo).

	-- Jachym