From owner-freebsd-hackers Mon Jul 14 00:54:24 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA06609 for hackers-outgoing; Mon, 14 Jul 1997 00:54:24 -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 AAA06430; Mon, 14 Jul 1997 00:49:49 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id IAA10143; Mon, 14 Jul 1997 08:44:35 +0200 From: Luigi Rizzo Message-Id: <199707140644.IAA10143@labinfo.iet.unipi.it> Subject: snd driver attach routine To: hasty@rah.star-gate.com (Amancio Hasty) Date: Mon, 14 Jul 1997 08:44:35 +0200 (MET DST) Cc: rhh@ct.picker.com, multimedia@FreeBSD.ORG, hackers@FreeBSD.ORG In-Reply-To: <199707140136.SAA00270@rah.star-gate.com> from "Amancio Hasty" at Jul 13, 97 06:35:45 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk [I am Cc'ing this to hackers since there someone might have some useful suggestion] Problem: what should be the return type of *attach() routines ? > 2. "< long attach_awe_obsolete(long mem_start, struct address_info *hw_config); > > void attach_awe_obsolete(struct address_info *hw_config);" > > That is to sort out long vs. void for attach routines. Personally, > I think the return type should be "long" but lets see > what Luigi had in mind. I have checked /sys/i386/isa/isa.c -- while the attach routine has return type "int", it is not tested for failure, which means that it better not fail :) . Note that there is no consistency at all about this in the various driver. Many (including sio.c and others that I wrote, e.g. asc.c) can fail in the attach routine, but this might mean nothing, just that I copied from a bad example (and in the case of sio.c, the attach routine is also called from another part of the driver). The drivers in /sys/pci all return void for the attach routine. So I'd go for the following: - make "void" the return type of all soundcard attach routines; - move all actions which might fail (e.g. allocate memory ?) to the probe routine; - do not invoke the probe routine again during the attach. Does this sound (er... look ?:) reasonable ? Should we also fix the existing isa drivers accordingly, if possible ? 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/ _____________________________|______________________________________