From owner-cvs-all Mon Sep 20 15:53: 7 1999 Delivered-To: cvs-all@freebsd.org Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (Postfix) with ESMTP id 03EB314FB1; Mon, 20 Sep 1999 15:49:37 -0700 (PDT) (envelope-from julian@whistle.com) Received: from current1.whistle.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.9.1a/8.9.1) with SMTP id OAA84961; Mon, 20 Sep 1999 14:27:04 -0700 (PDT) Date: Mon, 20 Sep 1999 14:27:04 -0700 (PDT) From: Julian Elischer To: Poul-Henning Kamp Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: devsw registration (modules/newbus/etc.) In-Reply-To: <24984.937861138@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk On Mon, 20 Sep 1999, Poul-Henning Kamp wrote: > In message , Juli > an Elischer writes: > >> Register devsw in *attach instead of a SYSINIT. > > > >I have doubts as to whether this is the right thing to do.. > > Why would you want to register a cdevsw until you have found some > hardware that need it ? Because it's part of the driver registration amd not part of the individual device registration.. The init routine is for driver registration functions so that's where it belongs. It's no great loss to register a driver even if it has no items.. All it is doing is filling in a single entry in the array. We don't lose memory resources to do so. It's the drive linking itself into all it's "hooks" regardless of what it later finds.. It's the principle of the matter.. Doing it in the attach is the wrong place, and it doesn't cost us anything to do it in the right place.. Even if the devsw stuff eventually goes away, while it exists it should be grouped in the right place with other functions which share the same operational scope. (and it tales less code because you don't need to check if it needs to be done). > > -- > Poul-Henning Kamp FreeBSD coreteam member > phk@FreeBSD.ORG "Real hackers run -current on their laptop." > FreeBSD -- It will take a long time before progress goes too far! > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message