public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Greg KH <gregkh@suse.de>
Cc: Jim Cromie <jim.cromie@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 00/23] add register_chrdev_ids() to char_dev.c, API
Date: Sun, 22 May 2011 07:55:03 -0700	[thread overview]
Message-ID: <20110522145503.GA14822@kroah.com> (raw)
In-Reply-To: <20110521211423.GA24330@suse.de>

On Sat, May 21, 2011 at 02:14:23PM -0700, Greg KH wrote:
> On Fri, May 20, 2011 at 11:15:04PM -0600, Jim Cromie wrote:
> > On Thu, May 19, 2011 at 4:44 PM, Greg KH <gregkh@suse.de> wrote:
> > > On Thu, May 19, 2011 at 03:33:03PM -0600, Jim Cromie wrote:
> > >> over on kernelnewbies, gregkh said:
> > >>
> > >>      The chardev stuff is a mess, I keep meaning for years to clean it
> > >>      up.  Any proposals on a sane interface for this stuff is greatly
> > >>      appreciated.
> > >>
> > >> this is a 1st step.
> > >>
> > >> register_chrdev_ids() replaces and deprecates register_chrdev_region()
> > >> and alloc_chrdev_region() with a single function that works for both
> > >> dynamic and static major numbers.
> > >>
> > >> Like alloc_chrdev_region(), 1st arg is a dev_t*, but its an in/out
> > >> parameter, and expects both major and minor to be preset, and thus the
> > >> separate minor arg is dropped.  If major == 0, a dynamic major is
> > >> reserved, saved into 1st arg, and thus available to caller afterwards.
> > >>
> > >> [PATCH 01/23] add register_chrdev_ids() to char_dev.c, API
> > >> [PATCH 02/23] reimplement alloc_chrdev_region with
> > >> [PATCH 03/23] use register_chrdev_ids to replace
> > >> [PATCH 04/23] use register_chrdev_ids in drivers/tty/
> > >> [PATCH 05/23] use register_chrdev_ids in drivers/infiniband/
> > >> [PATCH 06/23] use register_chrdev_ids in drivers/media/
> > >> [PATCH 07/23] use register_chrdev_ids in drivers/s390/
> > >> [PATCH 08/23] use register_chrdev_ids in drivers/scsi/
> > >> [PATCH 09/23] use register_chrdev_ids in drivers/staging/
> > >>
> > >> Ive held back the rest, no point in spamming.
> > >
> > > It's a nice first step, but that's the easy part, what is your 2nd
> > > through 4th one going to be?  :)
> > >
> > > I'd also like to sanatize the function namespace a bit as well, how
> > > about chrdev_register_ids() instead?
> > 
> > that seems sensible, modern.
> > also have register_chrdev(), which I presume should also be fixed.
> > 
> > > Ideally, we could drop down to a single register/unregister pair of
> > > functions, that are easy to use and understand.
> > 
> > __register_chrdev() does more stuff, mainly around cdevs, fops.
> > If fops was passed as NULL, we just do the __register_chardev_region()
> > and return early, skipping the cdev_alloc() and everything afterwards,
> > thus yielding register_chrdev_ids() behavior.
> > 
> > > Do you think you can
> > > get there with this intermediate step or do you want to step back and
> > > rethink this?
> > 
> > hmm.  If above is right, theres no need for the new api fn I added,
> > and probably should also drop the __ on both (un)?register_chardev.
> > So thats step 2 :)  Any ideas for 3 ?
> 
> Well, what do you think the end result should look like?  That will
> determine the steps needed here.

Oh, I also forgot, you need to look at the cdev_* api as well, that all
needs to be merged together with what you decide on here.

good luck,

greg k-h

      reply	other threads:[~2011-05-22 15:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 21:33 [PATCH 00/23] add register_chrdev_ids() to char_dev.c, API Jim Cromie
2011-05-19 21:33 ` [PATCH 02/23] reimplement alloc_chrdev_region with register_chrdev_ids Jim Cromie
2011-05-19 21:33 ` [PATCH 03/23] use register_chrdev_ids to replace (register|alloc)_chrdev_region Jim Cromie
2011-05-19 21:33 ` [PATCH 04/23] use register_chrdev_ids in drivers/tty/ Jim Cromie
2011-05-19 21:33 ` [PATCH 05/23] use register_chrdev_ids in drivers/infiniband/ Jim Cromie
2011-05-19 21:33 ` [PATCH 06/23] use register_chrdev_ids in drivers/media/ Jim Cromie
2011-05-21 12:48   ` Mauro Carvalho Chehab
2011-05-19 21:33 ` [PATCH 07/23] use register_chrdev_ids in drivers/s390/ Jim Cromie
2011-05-19 21:33 ` [PATCH 08/23] use register_chrdev_ids in drivers/scsi/ Jim Cromie
2011-05-20 15:42   ` Boaz Harrosh
2011-05-21  4:21     ` Jim Cromie
2011-05-21  7:59       ` Boaz Harrosh
2011-05-19 21:33 ` [PATCH 09/23] use register_chrdev_ids in drivers/staging/ Jim Cromie
2011-05-19 22:44 ` [PATCH 00/23] add register_chrdev_ids() to char_dev.c, API Greg KH
2011-05-21  5:15   ` Jim Cromie
2011-05-21 21:14     ` Greg KH
2011-05-22 14:55       ` Greg KH [this message]

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=20110522145503.GA14822@kroah.com \
    --to=greg@kroah.com \
    --cc=gregkh@suse.de \
    --cc=jim.cromie@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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