From: Wim Van Sebroeck <wim@iguana.be>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: Add support for the WM8350 watchdog
Date: Fri, 24 Oct 2008 14:37:23 +0200 [thread overview]
Message-ID: <20081024123723.GQ30246@infomag.infomag.iguana.be> (raw)
In-Reply-To: <1224529931-9860-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Hi Marc,
Finally a stable ADSL line again. I just finished reviewing your driver:
> +static int wm8350_wdt_open(struct inode *inode, struct file *file)
> +{
> + struct wm8350 *wm8350 = get_wm8350();
> + int ret;
> +
> + if (!wm8350) {
> + printk(KERN_CRIT "FNORD\n");
:-) as you pointed out this should be removed.
> +static int wm8350_wdt_release(struct inode *inode, struct file *file)
> +{
> + struct wm8350 *wm8350 = get_wm8350();
> +
> + if (wm8350_wdt_expect_close)
> + wm8350_wdt_stop(wm8350);
> + else
> + dev_warn(wm8350->dev, "Watchdog device closed uncleanly\n");
you should ping the watchdog if you don't stop it.
> +static int wm8350_wdt_ioctl(struct inode *inode, struct file *file,
> + unsigned int cmd, unsigned long arg)
we use the unlocked_ioctl call in watchdog drivers now. So this should be:
static long wm8350_wdt_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
> +{
> + struct wm8350 *wm8350 = get_wm8350();
> + int ret = -ENOTTY, time, i;
> + void __user *argp = (void __user *)arg;
> + int __user *p = argp;
> + u16 reg;
> +
> + switch (cmd) {
> + case WDIOC_GETSUPPORT:
> + ret = copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
> + break;
> +
> + case WDIOC_GETSTATUS:
Bootstatus is a mandatory ioctl according to the API. So just add:
case WDIOC_GETBOOTSTATUS:
> +static const struct file_operations wm8350_wdt_fops = {
> + .owner = THIS_MODULE,
> + .llseek = no_llseek,
> + .write = wm8350_wdt_write,
> + .ioctl = wm8350_wdt_ioctl,
and for the unlocked_ioctl call this needs to be:
.unlocked_ioctl = wm8350_wdt_ioctl,
For the rest: seems OK to me.
Kind regards,
Wim.
next prev parent reply other threads:[~2008-10-24 12:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-20 19:12 Mark Brown
2008-10-20 21:00 ` Wim Van Sebroeck
2008-10-21 9:57 ` Mark Brown
2008-10-24 12:37 ` Wim Van Sebroeck [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-11-06 10:56 Mark Brown
2008-10-27 15:31 Mark Brown
2008-10-30 22:18 ` Andrew Morton
2008-10-31 11:34 ` Mark Brown
2008-10-10 13:55 Mark Brown
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=20081024123723.GQ30246@infomag.infomag.iguana.be \
--to=wim@iguana.be \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®