LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Mike Frysinger" <vapier.adi@gmail.com>
Cc: "Marc Pignat" <marc.pignat@hevs.ch>,
	wim@iguana.be, linux-kernel@vger.kernel.org
Subject: Re: [RFC, PATCH] watchdog on gpio
Date: Mon, 14 Jan 2008 09:03:29 +0000	[thread overview]
Message-ID: <20080114090329.6efa2921@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <8bd0f97a0801140004q6a32c2ceh397a2208d3012f0e@mail.gmail.com>

> > #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);
> > +               return 0;
> 
> this two lines should be merged.

No.

> > +       default:
> > +               return -ENOIOCTLCMD;
> 
> should be -ENOTTY like all the other watchdogs

Yes. That's a common confusion. -ENOIOCTLCMD is a magic code used
internally by some mid layers to indicate the driver doesn't know the
ioctl so use default behaviour. -ENOTTY (confusingly but this is Unix
history) is the right answer for unknowns.
> 
> > +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 make inlined strings __initdata without breaking
some compilers. So it is correct.

> 
> > +static int __init gpio_wdt_probe(struct platform_device *pdev)
> 
> shouldnt this be __devinit ?

IFF the device can be found/removed dynamically.

> > +       if (watchdog) {
> > +               printk(KERN_ERR PFX "only one device supported\n");
> > +               return -ENODEV;
> > +       }
> 
> why ?  it'd be trivial to abstract this driver away from a global
> "watchdog" state into a proper arbitrary # of gpio watchdogs.

The core watchdog code only supports one watchdog currently. This again
is correct.


  reply	other threads:[~2008-01-14  9:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-10 15:11 Marc Pignat
2008-01-10 17:14 ` Ben Dooks
2008-01-11 16:40 ` Florian Fainelli
2008-01-14  7:34   ` Marc Pignat
2008-01-14  8:08   ` Mike Frysinger
2008-01-14  8:04 ` Mike Frysinger
2008-01-14  9:03   ` Alan Cox [this message]
2008-01-14  9:28     ` Mike Frysinger
2008-01-14  9:29       ` Alan Cox
2008-01-14  9:45         ` Mike Frysinger
2008-01-14 12:14           ` Haavard Skinnemoen
2008-01-14 12:22             ` Mike Frysinger
2008-01-14 13:30               ` Haavard Skinnemoen
2008-01-14 12:49           ` Johannes Weiner
2008-01-14 13:03             ` Mike Frysinger
2008-01-14 13:56               ` printk-wrapper with sectionized string constants [was: Re: [RFC, PATCH] watchdog on gpio] Johannes Weiner

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=20080114090329.6efa2921@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.pignat@hevs.ch \
    --cc=vapier.adi@gmail.com \
    --cc=wim@iguana.be \
    --subject='Re: [RFC, PATCH] watchdog on gpio' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).