Date: Mon, 20 Sep 1999 14:27:04 -0700 (PDT) From: Julian Elischer <julian@whistle.com> To: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: devsw registration (modules/newbus/etc.) Message-ID: <Pine.BSF.3.95.990920141933.6309K-100000@current1.whistle.com> In-Reply-To: <24984.937861138@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 20 Sep 1999, Poul-Henning Kamp wrote: > In message <Pine.BSF.3.95.990920133114.6309F-100000@current1.whistle.com>, 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.990920141933.6309K-100000>