lkml.org 
[lkml]   [2003]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectDynamic allocation of char majors in the new world order
From
Date
Once again, I'm trying to figure out how char drivers are really going to
work once the dust has settled around the dev_t changes. The new
register_chrdev_region() and cdev_* functions are reasonably easy to get a
grasp of, for the most part. But I'm curious about one thing: what do you
do if you want to use the new functions with dynamic major number
allocation?

Passing zero for the major number into register_chrdev_region() does almost
what one would want - it allocates a number for the caller. The one thing
it does *not* do, however, is communicate that number back to the caller in
any way. If you want to know what number you got, you have to call
__register_chrdev_region(), but that's static and uses a private structure
type - clearly not meant to be used that way.

Now, it wouldn't be that hard to hack register_chrdev_region() to save out
the actual major number and return it to the caller. But I get the sense
that things ultimately are not meant to work that way. I'm not a
particularly sensitive guy, but even I can notice little things like
comments reading "/* temporary */". So...is there some grand design out
there on how dynamic majors are really supposed to work in 2.6? Is it
rational to be trying to write something about char device registration at
this point?

Thanks,

jon

Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.018 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site