From owner-cvs-all Mon Sep 20 15: 0: 7 1999 Delivered-To: cvs-all@freebsd.org Received: from ns.skylink.it (ns.skylink.it [194.177.113.1]) by hub.freebsd.org (Postfix) with ESMTP id 8857014F7C; Mon, 20 Sep 1999 14:59:07 -0700 (PDT) (envelope-from hibma@skylink.it) Received: from heidi.plazza.it (va-139.skylink.it [194.185.55.139]) by ns.skylink.it (8.9.1/8.8.8) with ESMTP id AAA08672; Tue, 21 Sep 1999 00:00:04 +0200 Received: from localhost (localhost [127.0.0.1]) by heidi.plazza.it (8.9.3/8.8.5) with ESMTP id VAA11899; Mon, 20 Sep 1999 21:59:03 GMT X-No-Spam: Neither the receipients nor the senders email address(s) are to be used for Unsolicited (Commercial) Email without the explicit written consent of either party; as a per-message fee is incurred for inbound and outbound traffic to the originator. Posted-Date: Mon, 20 Sep 1999 21:59:03 GMT Date: Mon, 20 Sep 1999 23:59:02 +0200 (CEST) From: Nick Hibma X-Sender: n_hibma@heidi.plazza.it Reply-To: Nick Hibma To: Poul-Henning Kamp Cc: Julian Elischer , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: devsw registration (modules/newbus/etc.) In-Reply-To: <25218.937863294@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > >> 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.. > > Frist remember that cdevsw_add() is destined to be replaced with > make_dev() whereever possible, so that DEVFS has something to work > with. > > Second the devsw should not be registered unless some hardware is > found, another driver might need to register this slot for > compatibilty (ata vs wd driver for instace). > > Third I simply don't agree that registering your cdevsw is part of > the driver registration, in fact, we should move away from that > mistake. That depends on what make_dev does. If it creates the devsw for all devices attached by that driver, it definitely is part of the driver _initialisation_. But I do agree that it make sense to postpone when possible till it is actually needed. In any case, from what I see at a quick glance the code is forgiving in the case of duplicate assignment, in that it returns the assigned entry, so calling make_dev at every device that is being created should be fine. Nick. -- e-Mail: hibma@skylink.it To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message