Re: [PATCH] LDT - Linux Driver Template

2012-11-16 Thread Jean-Christophe PLAGNIOL-VILLARD
On 11:13 Wed 14 Nov , Alan Cox wrote: > Doing this is the past has always led to obsolete stale broken examples > because they are not actively in use and maintained. Far better to work > from actual live in use driver code. exactly what I tell him on ce-linux Best Regards, J. -- To unsubscri

Re: [PATCH] LDT - Linux Driver Template

2012-11-14 Thread Constantine Shulyupin
On Wed, Nov 14, 2012 at 5:42 AM, Ryan Mallon wrote: > On 14/11/12 05:46, Constantine Shulyupin wrote: >> From: Constantine Shulyupin >> + if (kfifo_is_empty(&in_fifo)) { > > Doesn't this require locking against whatever is filling the fifo? I seems doesn't. Note from include/linux/kfifo.h /*

Re: [PATCH] LDT - Linux Driver Template

2012-11-14 Thread Alan Cox
Doing this is the past has always led to obsolete stale broken examples because they are not actively in use and maintained. Far better to work from actual live in use driver code. Alan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord..

Re: [PATCH] LDT - Linux Driver Template

2012-11-13 Thread Ryan Mallon
On 14/11/12 05:46, Constantine Shulyupin wrote: > From: Constantine Shulyupin > > LDT is useful for Linux driver development beginners, > hackers and as starting point for a new drivers. > The driver uses following Linux facilities: module, platform driver, > file operations (read/write, mmap, io

Re: [PATCH] LDT - Linux Driver Template

2012-11-13 Thread Greg KH
On Wed, Nov 14, 2012 at 02:14:58AM +0200, Constantine Shulyupin wrote: > On Tue, Nov 13, 2012 at 9:01 PM, Greg KH wrote: > >> +#define pr_debug_hex(h) pr_debug("%s:%d %s %s = 0x%lX\n", \ > >> + __file__, __LINE__, __func__, #h, (long int)h) > > > > This is not needed at all, just use the

Re: [PATCH] LDT - Linux Driver Template

2012-11-13 Thread Constantine Shulyupin
On Tue, Nov 13, 2012 at 9:01 PM, Greg KH wrote: >> +#define pr_debug_hex(h) pr_debug("%s:%d %s %s = 0x%lX\n", \ >> + __file__, __LINE__, __func__, #h, (long int)h) > > This is not needed at all, just use the proper printk() attribute. Macro above allows tidy tracing code: pr_deb

Re: [PATCH] LDT - Linux Driver Template

2012-11-13 Thread Constantine Shulyupin
> 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

Re: [PATCH] LDT - Linux Driver Template

2012-11-13 Thread Greg KH
On Wed, Nov 14, 2012 at 01:19:06AM +0200, Constantine Shulyupin wrote: > On Wed, Nov 14, 2012 at 1:02 AM, Greg KH 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 goi

Re: [PATCH] LDT - Linux Driver Template

2012-11-13 Thread Constantine Shulyupin
On Wed, Nov 14, 2012 at 1:02 AM, Greg KH 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 dev

Re: [PATCH] LDT - Linux Driver Template

2012-11-13 Thread Greg KH
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? -- To unsubscri

Re: [PATCH] LDT - Linux Driver Template

2012-11-13 Thread Constantine Shulyupin
>> + * 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? Thank you. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord.

Re: [PATCH] LDT - Linux Driver Template

2012-11-13 Thread Greg KH
On Tue, Nov 13, 2012 at 08:46:37PM +0200, Constantine Shulyupin wrote: > +++ b/samples/ltd/ldt.c > @@ -0,0 +1,764 @@ > +/* > + * LDT - Linux Driver Template > + * > + * Copyright (C) 2012 Constantine Shulyupin http://www.makelinux.net/ > + * > + * Dual BSD/GPL License That makes no sense for