Driver initialisation: Bug or feature ?

Henrik Storner (storner@image.dk)
Wed, 10 Sep 1997 23:06:12 +0200 (MET DST)


I stumbled on this at work, and wondered if this really is how it was
meant to be:

When initialising drivers built into the kernel - e.g. drivers for
network cards - the code goes like this:

if ( 1 &&
#ifdef CONFIG_A
hw_a_probe() &&
#endif
#ifdef CONFIG_B
hw_b_probe() &&
#endif

However, this means that if you have defined both CONFIG_A and
CONFIG_B, but the probe for the A device fails, then the B device is
never probed (because the evaluation of the if-statement is false as
soon as one of the probes fail).

My problem was that I my token-ring card was never being initialized;
I looked all over for errors with this card, but the real problem was
that an NE2000 driver was also built into the kernel, but no such card
was installed in the system. The token-ring card was never probed when
the NE2000 probe failed.

Took me a while to figure that one out.

-- 
Henrik Storner                               http://www.image.dk/~storner/ 
"The POP3 server service depends on the SMTP server service, which
 failed to start because of the following error:
 The operation completed successfully." -Windows NT Server v3.51