[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121113233226.GA25922@kroah.com>
Date: Tue, 13 Nov 2012 15:32:26 -0800
From: Greg KH <gregkh@...uxfoundation.org>
To: Constantine Shulyupin <const@...elinux.com>
Cc: linux-kernel@...r.kernel.org, celinux-dev@...ts.celinuxforum.org
Subject: Re: [PATCH] LDT - Linux Driver Template
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@...uxfoundation.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists