diff options
| author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2003-04-07 19:38:01 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-07 19:38:01 -0700 |
| commit | 667c52f5ae3ad16c2efbf9ffee68f4b6d72f7494 (patch) | |
| tree | 9a713c321b7664244134bd37ee3313ac3740c773 | |
| parent | b9fdf64432bb825be895c1d3511d3cc8f21c40ae (diff) | |
[PATCH] error handling for upd4990a
(Stephan Maciej)
| -rw-r--r-- | drivers/char/upd4990a.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/char/upd4990a.c b/drivers/char/upd4990a.c index 12190561a7fa..f06f509fb5f8 100644 --- a/drivers/char/upd4990a.c +++ b/drivers/char/upd4990a.c @@ -343,19 +343,28 @@ static struct miscdevice rtc_dev= 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); |
