You are incorrect in assuming you can't find out if another child already
exists.. Usually this is a problem of properly allocating resources so
that you know the other child exists. Since you are using identify, you
already don't have a "self describing" bus, which means that you have
to either use hints, or another method to make sure that your device
doesn't already exist.
It's not quite that simple. See the block comment at the top of
src/sys/dev/ichwd/ichwd.c for an explanation.
Sorry, I had an out of date cvsup and hadn't received ichwd yet.
You're always going to be a child of nexus, and since I assume from
the comment that there can only ever be one child. Also, why do you
find_child w/ unit number 0, but then add a child with unit -1? Why
not add it unit 0, and make it fail if that already exists?
Also, it seems to me that if dev already exists, that you shouldn't
reset the driver and desc. This should be harmless, but if for some
reason you are called on an attached device, it could cause problems.
John-Mark Gurney Voice: +1 415 225 5579
"All that I will do, has been done, All that I have, has not."