Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Sep 1999 16:30:33 -0700 (PDT)
From:      Julian Elischer <julian@whistle.com>
To:        Nick Hibma <hibma@skylink.it>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: devsw registration (modules/newbus/etc.) 
Message-ID:  <Pine.BSF.3.95.990920162829.6478B-100000@current1.whistle.com>
In-Reply-To: <Pine.BSF.4.10.9909202352100.11288-100000@heidi.plazza.it>

next in thread | previous in thread | raw e-mail | index | archive | help
you've missed my point entirely..
I'm not saying that make_dev() should be in the init()
but that the insertion of the cdevsw struct into the cdevsw array
is a 'once per driver' operation and not dependent on the number iof
instances found, therefore it should be done in the init function where
the dirver hooks itself into the kernel.

 On Mon, 20 Sep 1999, Nick Hibma
wrote:

> > >> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.990920162829.6478B-100000>