[driver-discuss] cdev with GLDv2 driver?

Garrett D'Amore garrett at damore.org
Mon Aug 20 18:59:39 PDT 2007


On Mon, 2007-08-20 at 14:45 -0400, Andrew Gallatin wrote:
> Garrett D'Amore writes:
>  > 
>  > Assume you have two device driver, "real" and "alias"  (poor names, but 
>  > easier for the illustration.)  I'm writing this without clone driver 
>  > support... you can add that in yourself.  Also, I've elided a few error 
>  > checks, and a few of the utilities to map between dev_t's and instances, 
>  > but you should already know how to do deal with that...  here's some 
>  > sample coded logic...
>  > 
> 
> I have a dumb question.  Why do you do all the refcounting work at
> open time?  Why not simply take a reference when the "alias" pseudo
> driver attaches?

Because then you could *never* detach.  (At least as long as the alias
driver is around.)  This way we hold the reference only when the
instance is *in use*, but if its sitting around idle, still allow it to
be detached.

	-- Garrett
> 
> Thanks,
> 
> Drew



More information about the driver-discuss mailing list