public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Rajat Jain <rajat.noida.india@gmail.com>
Cc: kernelnewbies <kernelnewbies@nl.linux.org>,
	newbie <linux-newbie@vger.kernel.org>
Subject: Re: Query regarding alloc_chrdev_region()
Date: Thu, 29 Mar 2007 22:19:26 -0700	[thread overview]
Message-ID: <20070330051926.GC26194@kroah.com> (raw)
In-Reply-To: <b115cb5f0703291936p2a46ceccx892c6b25bf07021b@mail.gmail.com>

On Fri, Mar 30, 2007 at 08:06:23AM +0530, Rajat Jain wrote:
> Hi,
> 
> >> I was wondering that while using dynamic device numner allocation, can
> >> we ever have a scenario like following (using alloc_chrdev_region):
> >>
> >> 1) Char Driver A is hooked on Major num X, minor numbers 0-10
> >> 2) Char Driver B is hooked on (same) Major num X, minor numbers 11-20
> 
> So the above is actually possible?

Yes, once you have a major number, you can separate out the minor
numbers how ever you wish to.

> >> If yes, how will the userland get to know about the dynamically
> >> allocated range (needed to create device nodes), since /proc/devices
> >> only shows major numbers?
> >
> >Through the exporting of this information in sysfs by using the
> >device_create() call that you are required to do in order to have your
> >device show up properly there :)
> 
> Is that taken care by cdev_add() itself?

Nope, not at all.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs

  reply	other threads:[~2007-03-30  5:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-29 17:20 Query regarding alloc_chrdev_region() Rajat Jain
2007-03-30  2:10 ` Greg KH
2007-03-30  2:36   ` Rajat Jain
2007-03-30  5:19     ` Greg KH [this message]
2007-03-30  6:26       ` Rajat Jain
2007-03-30  6:34         ` Greg KH

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=20070330051926.GC26194@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-newbie@vger.kernel.org \
    --cc=rajat.noida.india@gmail.com \
    /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