Subject: Re: CVS commit: syssrc
To: Lennart Augustsson <lennart@mail.augustsson.net>
From: Chris G. Demetriou <cgd@sibyte.com>
List: port-i386
Date: 12/20/2000 17:50:03
lennart@mail.augustsson.net (Lennart Augustsson) writes:
> Yes, we should change the attach routines to return a value to indicate
> failure. Many drivers need it.
I'm not sure that I agree. In what situation do you _need_ to return
an attach failure?
The only things i can think of are resource allocation problems. For
some reasources, the code should probably be checking up front in the
match routines. (e.g. can I use this bloody IRQ after all? just like
it checks use of I/O space, etc.) For others that I can think of, the
use of waiting calls should make the right thing happen.
So, really, If you can't attach, you shouldn't have matched
successfully.
One conceptual problem with allowing code to back out of matches is
something like: OK, say i've got a specific driver which doesn't
succeed in attaching, but also had a lower-priority match generic
driver. It may make sense for that lower-priority driver to be
attached in place of the specific driver, and that's prevented if the
specific driver actually matches with a high priority. I suppose you
could solve that by keeping a stack of matches, but ... it seems
better to just match more carefully.
I'm sure there are others, but I'd actually have to _think_ about it.
8-)
cgd