From: Jonathan Corbet <corbet@lwn.net>
To: linux-kernel@vger.kernel.org
Cc: viro@parcelfarce.linux.theplanet.co.uk
Subject: Dynamic allocation of char majors in the new world order
Date: Tue, 16 Sep 2003 13:24:49 -0600 [thread overview]
Message-ID: <20030916192449.8450.qmail@lwn.net> (raw)
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
next reply other threads:[~2003-09-16 19:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-16 19:24 Jonathan Corbet [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-09-17 19:52 Dynamic allocation of char majors in the new world order Jonathan Corbet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030916192449.8450.qmail@lwn.net \
--to=corbet@lwn.net \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox