>I think I get the rationale for not testing return value in the attach
>After the probe you (should) know that the peripheral is there. A
>failure to attach should then depend only on os problems (typically,
>failure to allocate resources such as memory, dma, irq, or a device
>descriptor). Since no resource allocation was in the probe, the routine
>calling the attach has nothing to do on failure -- all deallocations
>should be done in the attach routine being device specific.
In practice, for isa devices the IRQ allocation is done in generic code,
so the probe status is necessary (but not used).
>Secondly, if I am not mistaken, once you create a device entry in the
>fs with a major number corresponding to an existing device, the
>routines for the devices are always invoked and they have to check the
>minor dev anyways to see if it corresponds to a configured device.
This is a bug. Drivers whose probe or attach can fail should not use
SYSINIT() to register their device switches.