From: Greg KH <gregkh@linuxfoundation.org>
To: Constantine Shulyupin <const@makelinux.com>
Cc: linux-kernel@vger.kernel.org, celinux-dev@lists.celinuxforum.org
Subject: Re: [PATCH] LDT - Linux Driver Template
Date: Tue, 13 Nov 2012 15:32:26 -0800 [thread overview]
Message-ID: <20121113233226.GA25922@kroah.com> (raw)
In-Reply-To: <CAE7jHC9EU=1VWG+quFZw=9b9GTh+TLzCQQvpS0qMKXNznVZZYA@mail.gmail.com>
On Wed, Nov 14, 2012 at 01:19:06AM +0200, Constantine Shulyupin wrote:
> On Wed, Nov 14, 2012 at 1:02 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Wed, Nov 14, 2012 at 12:31:13AM +0200, Constantine Shulyupin wrote:
> >> >> + * Device Model (class, device)
> >> > Don't use class code in an example, it is slowly going away from the
> >> > whole kernel.
> >> What to use instead class_create and device_create?
> >
> > What are you trying to do?
>
> I trying to properly register char device and device region.
> Single char device could be registered as misc device with just misc_register.
When you do that, the struct device is automatically registered with the
system, why do you need to do it again?
> How to register properly char devices region?
Using the proper calls, which are not the misc_register ones :)
> Should to use device_register instead device_create to create dev files?
Depends on what you want to do :)
> Which other registration functions char device must to call besides
> alloc_chrdev_region, cdev_add?
Again, I think you are mixing two different things here. You can't mix
the char interface with the misc_register interface, they don't play
well, it's either one or the other.
Now I agree using the char interface isn't the most "obvious" and I have
a set of ideas/half-baked patches floating around that aim to clean it
up, but for now, I'd recommend just using the misc interface, it's
worlds simpler, makes sense, and handles all of the struct device work
for you automatically.
thanks,
greg k-h
next prev parent reply other threads:[~2012-11-13 23:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 18:46 [PATCH] LDT - Linux Driver Template Constantine Shulyupin
2012-11-13 19:01 ` Greg KH
2012-11-13 22:31 ` Constantine Shulyupin
2012-11-13 23:02 ` Greg KH
2012-11-13 23:19 ` Constantine Shulyupin
2012-11-13 23:32 ` Greg KH [this message]
2012-11-13 23:51 ` Constantine Shulyupin
2012-11-14 0:14 ` Constantine Shulyupin
2012-11-14 0:48 ` Greg KH
2012-11-14 0:59 ` [Celinux-dev] " Tim Bird
2012-11-14 3:42 ` Ryan Mallon
2012-11-14 13:04 ` Constantine Shulyupin
2012-11-14 11:13 ` Alan Cox
2012-11-16 9:57 ` Jean-Christophe PLAGNIOL-VILLARD
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=20121113233226.GA25922@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=celinux-dev@lists.celinuxforum.org \
--cc=const@makelinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.