printk-wrapper with sectionized string constants [was: Re: [RFC, PATCH] watchdog on gpio]

2008-01-14 Thread Johannes Weiner
Hi, "Mike Frysinger" <[EMAIL PROTECTED]> writes: >> How about: >> >> #define init_printk(fmt, args...) ({\ >> static const __init char __fmt[] = fmt; \ >> printk(__fmt, args);\ >> }) >> >> Now it returns the printk result. > > i wasnt really worried

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Haavard Skinnemoen
On Mon, 14 Jan 2008 07:22:39 -0500 "Mike Frysinger" <[EMAIL PROTECTED]> wrote: > > There is: platform_driver_probe(). It takes the probe function as a > > parameter so that it can be left out of the platform_driver struct. > > After it returns, there are no references to the probe function left >

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 14, 2008 7:49 AM, Johannes Weiner <[EMAIL PROTECTED]> wrote: > "Mike Frysinger" <[EMAIL PROTECTED]> writes: > > wonder if we could design a printk designed for __init functions to > > address this in a clean fashion. > > #define init_printk(fmt, __VA_ARGS__) \ > > do { \ > > static

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Johannes Weiner
Hi, "Mike Frysinger" <[EMAIL PROTECTED]> writes: > wonder if we could design a printk designed for __init functions to > address this in a clean fashion. > #define init_printk(fmt, __VA_ARGS__) \ > do { \ > static const __init char __fmt[] = fmt; \ > printk(__fmt , ## __VA_ARGS__); \ >

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 14, 2008 7:14 AM, Haavard Skinnemoen <[EMAIL PROTECTED]> wrote: > "Mike Frysinger" <[EMAIL PROTECTED]> wrote: > > there is no hard requirement anywhere that says platform resources > > must be in the board resources file. marking the functions as __init > > instead of __devinit will

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Haavard Skinnemoen
On Mon, 14 Jan 2008 04:45:25 -0500 "Mike Frysinger" <[EMAIL PROTECTED]> wrote: > there is no hard requirement anywhere that says platform resources > must be in the board resources file. marking the functions as __init > instead of __devinit will basically cause a kernel crash if someone > tries

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 14, 2008 4:29 AM, Alan Cox <[EMAIL PROTECTED]> wrote: > > > Saves memory - you can't make inlined strings __initdata without breaking > > > some compilers. So it is correct. > > > > you could make the same argument about all strings used in all __init > > functions. making a special case

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Alan Cox
> > Saves memory - you can't make inlined strings __initdata without breaking > > some compilers. So it is correct. > > you could make the same argument about all strings used in all __init > functions. making a special case for this one string is just > confusing. this is also used from the

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 14, 2008 4:03 AM, Alan Cox <[EMAIL PROTECTED]> wrote: > > > +static char banner[] __initdata = KERN_INFO PFX "fixed %d.%03d seconds > > > timeout (nowayout= %d)\n"; > > > > this only gets used once in the init function ... having it be broken > > out like this is kind of silly > > Saves

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Alan Cox
> > #include > > perhaps "watchdog" rather than "wdt" considering it's already > "linux/watchdog.h" ? or _wdt/wdt_ like the rest of the watchdog code uses for watchdog names (wdt ->watchdog timer). > > > + case WDIOC_KEEPALIVE: > > + gpio_wdt_keepalive(wdt); > > +

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 11, 2008 11:40 AM, Florian Fainelli <[EMAIL PROTECTED]> wrote: > Did you look into hooking into Wim's uniform watchdog driver : > > http://git.kernel.org/?p=linux/kernel/git/wim/linux-2.6-watchdog-experimental.git;a=commit;h=732c54027e6c866f98857c4a6d1c6c466459dcd5 > > Maybe you can save

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 10, 2008 10:11 AM, Marc Pignat <[EMAIL PROTECTED]> wrote: > watchdog driver for embedded systems with a supervisor watchdog (MAX823 or so) > connected to a gpio. This is the platform_driver and needs platform_data for > defining the gpio pin and the watchdog timeout. generic gpio watchdog

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 10, 2008 10:11 AM, Marc Pignat [EMAIL PROTECTED] wrote: watchdog driver for embedded systems with a supervisor watchdog (MAX823 or so) connected to a gpio. This is the platform_driver and needs platform_data for defining the gpio pin and the watchdog timeout. generic gpio watchdog is

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 11, 2008 11:40 AM, Florian Fainelli [EMAIL PROTECTED] wrote: Did you look into hooking into Wim's uniform watchdog driver : http://git.kernel.org/?p=linux/kernel/git/wim/linux-2.6-watchdog-experimental.git;a=commit;h=732c54027e6c866f98857c4a6d1c6c466459dcd5 Maybe you can save some code

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Alan Cox
#include linux/gpio_wdt.h perhaps watchdog rather than wdt considering it's already linux/watchdog.h ? or _wdt/wdt_ like the rest of the watchdog code uses for watchdog names (wdt -watchdog timer). + case WDIOC_KEEPALIVE: + gpio_wdt_keepalive(wdt); +

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 14, 2008 4:03 AM, Alan Cox [EMAIL PROTECTED] wrote: +static char banner[] __initdata = KERN_INFO PFX fixed %d.%03d seconds timeout (nowayout= %d)\n; this only gets used once in the init function ... having it be broken out like this is kind of silly Saves memory - you can't

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 14, 2008 4:29 AM, Alan Cox [EMAIL PROTECTED] wrote: Saves memory - you can't make inlined strings __initdata without breaking some compilers. So it is correct. you could make the same argument about all strings used in all __init functions. making a special case for this one

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Alan Cox
Saves memory - you can't make inlined strings __initdata without breaking some compilers. So it is correct. you could make the same argument about all strings used in all __init functions. making a special case for this one string is just confusing. this is also used from the *platfrom

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Haavard Skinnemoen
On Mon, 14 Jan 2008 04:45:25 -0500 Mike Frysinger [EMAIL PROTECTED] wrote: there is no hard requirement anywhere that says platform resources must be in the board resources file. marking the functions as __init instead of __devinit will basically cause a kernel crash if someone tries to use

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 14, 2008 7:14 AM, Haavard Skinnemoen [EMAIL PROTECTED] wrote: Mike Frysinger [EMAIL PROTECTED] wrote: there is no hard requirement anywhere that says platform resources must be in the board resources file. marking the functions as __init instead of __devinit will basically cause a

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Johannes Weiner
Hi, Mike Frysinger [EMAIL PROTECTED] writes: wonder if we could design a printk designed for __init functions to address this in a clean fashion. #define init_printk(fmt, __VA_ARGS__) \ do { \ static const __init char __fmt[] = fmt; \ printk(__fmt , ## __VA_ARGS__); \ } while

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Mike Frysinger
On Jan 14, 2008 7:49 AM, Johannes Weiner [EMAIL PROTECTED] wrote: Mike Frysinger [EMAIL PROTECTED] writes: wonder if we could design a printk designed for __init functions to address this in a clean fashion. #define init_printk(fmt, __VA_ARGS__) \ do { \ static const __init char

printk-wrapper with sectionized string constants [was: Re: [RFC, PATCH] watchdog on gpio]

2008-01-14 Thread Johannes Weiner
Hi, Mike Frysinger [EMAIL PROTECTED] writes: How about: #define init_printk(fmt, args...) ({\ static const __init char __fmt[] = fmt; \ printk(__fmt, args);\ }) Now it returns the printk result. i wasnt really worried about that ... i was

Re: [RFC, PATCH] watchdog on gpio

2008-01-14 Thread Haavard Skinnemoen
On Mon, 14 Jan 2008 07:22:39 -0500 Mike Frysinger [EMAIL PROTECTED] wrote: There is: platform_driver_probe(). It takes the probe function as a parameter so that it can be left out of the platform_driver struct. After it returns, there are no references to the probe function left around,

Re: [RFC, PATCH] watchdog on gpio

2008-01-13 Thread Marc Pignat
On Friday 11 January 2008, Florian Fainelli wrote: > Hello Marc, > > Your patch looks good to me, and I have been waiting for something like > this :). Other comments below. > > Le jeudi 10 janvier 2008, Marc Pignat a écrit : > > +#include > > +#include > > At first sight, this will only

Re: [RFC, PATCH] watchdog on gpio

2008-01-13 Thread Marc Pignat
On Friday 11 January 2008, Florian Fainelli wrote: Hello Marc, Your patch looks good to me, and I have been waiting for something like this :). Other comments below. Le jeudi 10 janvier 2008, Marc Pignat a écrit : +#include asm/uaccess.h +#include asm/arch/gpio.h At first sight,

Re: [RFC, PATCH] watchdog on gpio

2008-01-11 Thread Florian Fainelli
Hello Marc, Your patch looks good to me, and I have been waiting for something like this :). Other comments below. Le jeudi 10 janvier 2008, Marc Pignat a écrit : > +#include > +#include At first sight, this will only work with the platforms which have implemented gpiolib, some (like MIPS)

Re: [RFC, PATCH] watchdog on gpio

2008-01-11 Thread Florian Fainelli
Hello Marc, Your patch looks good to me, and I have been waiting for something like this :). Other comments below. Le jeudi 10 janvier 2008, Marc Pignat a écrit : +#include asm/uaccess.h +#include asm/arch/gpio.h At first sight, this will only work with the platforms which have implemented

Re: [RFC, PATCH] watchdog on gpio

2008-01-10 Thread Ben Dooks
On Thu, Jan 10, 2008 at 04:11:08PM +0100, Marc Pignat wrote: > watchdog driver for embedded systems with a supervisor watchdog (MAX823 or so) > connected to a gpio. This is the platform_driver and needs platform_data for > defining the gpio pin and the watchdog timeout. > > Signed-off-by: Marc

[RFC, PATCH] watchdog on gpio

2008-01-10 Thread Marc Pignat
watchdog driver for embedded systems with a supervisor watchdog (MAX823 or so) connected to a gpio. This is the platform_driver and needs platform_data for defining the gpio pin and the watchdog timeout. Signed-off-by: Marc Pignat <[EMAIL PROTECTED]> --- Hi! If you've got a max823, 824 or any

[RFC, PATCH] watchdog on gpio

2008-01-10 Thread Marc Pignat
watchdog driver for embedded systems with a supervisor watchdog (MAX823 or so) connected to a gpio. This is the platform_driver and needs platform_data for defining the gpio pin and the watchdog timeout. Signed-off-by: Marc Pignat [EMAIL PROTECTED] --- Hi! If you've got a max823, 824 or any cpu