Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jul 1997 12:48:38 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        bde@zeta.org.au, se@FreeBSD.ORG, hackers@FreeBSD.ORG, hasty@rah.star-gate.com, multimedia@FreeBSD.ORG, rhh@ct.picker.com
Subject:   Re: snd driver attach routine
Message-ID:  <199707211048.MAA21030@labinfo.iet.unipi.it>
In-Reply-To: <199707211133.VAA10007@godzilla.zeta.org.au> from "Bruce Evans" at Jul 21, 97 09:33:28 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> >> >Problem: what should be the return type of *attach() routines ?
> >> 
> >> Perhaps it should be void to match reality, but it currently must be
> >> int for isa drivers to match the prototype in `struct isa_driver'.
> >> 
> >> >The drivers in /sys/pci all return void for the attach routine.
> >> 
> >> They have to, to match the prototype in `strcuct pci_driver'.
> >
> >I could easily change the return type of 
> >the PCI attach function. Should I ???
> 
> If anything is attached above the driver level, then you need a status
> from the driver attach to decide whether to clean up or attach more.
> For ISA, only interrupts are attached at a high level, but they shouldn't
> be, so ISA attach function shouldn't need to return status (but they
> should clean up if they fail).  I'm not sure about PCI.

I think this should be done in a bus-independent way, and surely the
safest way is to always return an error code. Then you have the freedom
or ignoring it or not.

	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707211048.MAA21030>