Messages in this thread | | | Date | Tue, 3 May 2011 10:37:04 +0100 | From | Alan Cox <> | Subject | Re: [PATCH 2/2] watchdog: add support for MOXA V2100 watchdog driver |
| |
> 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
| |