On Thu, Dec 09, 1999 at 12:25:33PM +0900, Seigo Tanimura wrote:
> [snipped some part]
> >> > > On Tue, 7 Dec 1999 23:00:02 +0100 (MET),
> >> > >   Thomas Schuerger <[EMAIL PROTECTED]> said:
> >> > > 
> >> > > >> --- sbc.c.orig      Mon Dec  6 19:26:31 1999
> >> > > >> +++ sbc.c   Tue Dec  7 22:15:25 1999
> >> > > >> @@ -110,7 +110,7 @@
> >> > > >> if (error)
> >> > > >> return error;
> >> > > >> else
> >> > > >> -           return -100;
> >> > > >> +           return -1;
> >> > > >> }
> >> > > >> 
> >> > > >> static int
> 
> On Wed, 8 Dec 1999 08:54:15 -0500,
>   "Charles Anderson" <[EMAIL PROTECTED]> said:
> 
> Charles> So then what is -1 and why does it work when -100 doesn't? (I tried it)
> 
> 
> sys/kern/subr_bus.c:device_probe_child() receives the value returned
> by DEVICE_PROBE(child dev). If the value is zero, no further probes
> occur. The device then gets attached in sys/kern/subr_bus.c:
> device_probe_and_attach().
> 
Ahh, now it makes sense to me.

In case of an unknown device, error = ISA_PNP_PROBE(...) set error to
a value larger than 0. In case of a successfull match error is set to
0.

IMHO the correct probe should be:

sbc_probe(device_t dev)
{
        int error;

        /* Check pnp ids */
        error = ISA_PNP_PROBE(device_get_parent(dev), dev, sbc_ids);
        if (error >= 0)
                return error;
        else
                return -100;
} 

Is it possible that error gets a value below 0 ? In that case the
probe should arrange for this case.

Any comments ?

Frank
-- 
~/.signature not found: wellknown error 42


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to