Re: [PATCH 1/10 v2] Generic Watchdog Timer Driver

From: Mark Brown
Date: Wed Jun 22 2011 - 08:24:20 EST


On Sat, Jun 18, 2011 at 08:58:14PM +0200, Arnd Bergmann wrote:
> On Saturday 18 June 2011 19:19:46 Wim Van Sebroeck wrote:

> > +static DEFINE_TIMER(timer, wdt_timer_tick, 0, 0);
> > + /* The timer that pings the watchdog */
> > +static unsigned long next_heartbeat; /* the next_heartbeat for the timer */
> > +static unsigned long running; /* is watchdog running for userspace? */

> How about moving these into a structure that hangs off watchdog_device->priv?
> It would be nice if a driver could live without global variables, especially
> if you want to eventually support multiple concurrent watchdog instances.

Yes, please - even if we can only support a single watchdog at once it'd
be helpful if the common code took care of that limitation and drivers
mould be implemented with support for multiple watchdogs. It'll be less
work when the core does get this support and until then it means that
drivers don't need to worry about it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/