mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Jimmy Chen" <jimmy.chen@moxa.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-watchdog@vger.kernel.org>,
	<wim@iguana.be>
Subject: Re: [PATCH 2/2] watchdog: add support for MOXA V2100 watchdog driver
Date: Tue, 3 May 2011 10:37:04 +0100	[thread overview]
Message-ID: <20110503103704.69aba5b2@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <ECB3782BB8F03341905DD923270296115F7124@mhqms01.moxa.com>

> Add real function for watchdog driver

Looks a lot better

> +#define __KERNEL_SYSCALLS__
> +

You shouldn't need that define now


> +	/* we suppose to check magic id in case wrong devices */
> +	if (wdt_verify_vendor()) {
> +		printk(KERN_ERR "hw device id not match!!\n");
> +		ret = -ENODEV;
> +		goto reqreg_err;
> +	}

This wants to happen after the request_region - if the region is busy
then you know your device isn't present but that the addresses in
question are currently in use so you shouldn't touch them

We tend to use pr_err()/pr_debug() etc now rather than printk(KERN_ERR
"Oops"); to be less long winded - but the code you have there isn't wrong
in using printk().

With the tests re-ordered this looks fairly sound to me

Alan

  reply	other threads:[~2011-05-03  9:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03  5:36 [PATCH 1/2] " Jimmy Chen (陳永達)
2011-05-03  5:38 ` [PATCH 2/2] " Jimmy Chen (陳永達)
2011-05-03  9:37   ` Alan Cox [this message]
2011-05-03 10:25     ` Jimmy Chen (陳永達)
2011-05-03 10:29       ` Alan Cox
2011-05-03 10:57       ` Wolfram Sang
2011-05-03 11:15         ` Alan Cox
2011-05-03 12:51           ` Arnd Bergmann
2011-05-03 13:35             ` Alan Cox
2011-05-04  9:02               ` Jimmy Chen (陳永達)
2011-05-06  5:52                 ` Jimmy Chen (陳永達)
2011-05-06  6:59                   ` Arnd Bergmann
2011-05-19 16:01                   ` Wim Van Sebroeck

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=20110503103704.69aba5b2@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=jimmy.chen@moxa.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@iguana.be \
    /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

Powered by JetHome