From owner-freebsd-multimedia Mon Jul 21 04:52:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA09142 for multimedia-outgoing; Mon, 21 Jul 1997 04:52:50 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id EAA09074; Mon, 21 Jul 1997 04:51:47 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id MAA21030; Mon, 21 Jul 1997 12:48:38 +0200 From: Luigi Rizzo Message-Id: <199707211048.MAA21030@labinfo.iet.unipi.it> Subject: Re: snd driver attach routine To: bde@zeta.org.au (Bruce Evans) Date: Mon, 21 Jul 1997 12:48:38 +0200 (MET DST) Cc: bde@zeta.org.au, se@FreeBSD.ORG, hackers@FreeBSD.ORG, hasty@rah.star-gate.com, multimedia@FreeBSD.ORG, rhh@ct.picker.com In-Reply-To: <199707211133.VAA10007@godzilla.zeta.org.au> from "Bruce Evans" at Jul 21, 97 09:33:28 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > >> >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/ _____________________________|______________________________________