Commit 667c52f5 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] error handling for upd4990a

(Stephan Maciej)
parent b9fdf644
...@@ -343,19 +343,28 @@ static struct miscdevice rtc_dev= ...@@ -343,19 +343,28 @@ static struct miscdevice rtc_dev=
static int __init rtc_init(void) static int __init rtc_init(void)
{ {
int err = 0;
if (!request_region(UPD4990A_IO, 1, "rtc")) { if (!request_region(UPD4990A_IO, 1, "rtc")) {
printk(KERN_ERR "upd4990a: could not acquire I/O port %#x\n", printk(KERN_ERR "upd4990a: could not acquire I/O port %#x\n",
UPD4990A_IO); UPD4990A_IO);
return -EBUSY; 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 #if 0
printk(KERN_INFO "\xB6\xDA\xDD\xC0\xDE \xC4\xDE\xB9\xB2 Driver\n"); /* Calender Clock Driver */ printk(KERN_INFO "\xB6\xDA\xDD\xC0\xDE \xC4\xDE\xB9\xB2 Driver\n"); /* Calender Clock Driver */
#else #else
printk(KERN_INFO printk(KERN_INFO
"Real Time Clock driver for NEC PC-9800 v" RTC98_VERSION "\n"); "Real Time Clock driver for NEC PC-9800 v" RTC98_VERSION "\n");
#endif #endif
misc_register(&rtc_dev);
create_proc_read_entry("driver/rtc", 0, NULL, rtc_read_proc, NULL); create_proc_read_entry("driver/rtc", 0, NULL, rtc_read_proc, NULL);
init_timer(&rtc_uie_timer); init_timer(&rtc_uie_timer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment