PATCH: error handling for upd4990a

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 8 Apr 2003 01:14:53 +0100


(Stephan Maciej)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/drivers/char/upd4990a.c linux-2.5.67-ac1/drivers/char/upd4990a.c
--- linux-2.5.67/drivers/char/upd4990a.c 2003-03-26 19:59:51.000000000 +0000
+++ linux-2.5.67-ac1/drivers/char/upd4990a.c 2003-04-03 23:43:02.000000000 +0100
@@ -343,19 +343,28 @@

static int __init rtc_init(void)
{
+ int err = 0;
+
if (!request_region(UPD4990A_IO, 1, "rtc")) {
printk(KERN_ERR "upd4990a: could not acquire I/O port %#x\n",
UPD4990A_IO);
return -EBUSY;
}

+ err = misc_register(&rtc_dev);
+ if (err) {
+ printk(KERN_ERR "upd4990a: can't misc_register() on minor=%d\n",
+ RTC_MINOR);
+ release_region(UPD4990A_IO, 1);
+ return err;
+ }
+
#if 0
printk(KERN_INFO "\xB6\xDA\xDD\xC0\xDE \xC4\xDE\xB9\xB2 Driver\n"); /* Calender Clock Driver */
#else
printk(KERN_INFO
"Real Time Clock driver for NEC PC-9800 v" RTC98_VERSION "\n");
#endif
- misc_register(&rtc_dev);
create_proc_read_entry("driver/rtc", 0, NULL, rtc_read_proc, NULL);

init_timer(&rtc_uie_timer);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/