Re: [PATCH 2/2] watchdog: add support for MOXA V2100 watchdogdriver
From: Alan Cox
Date: Tue May 03 2011 - 05:36:07 EST
> 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
--
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/