From: Stephan Maciej <stephanm@muc.de>
To: linux-kernel@vger.kernel.org
Cc: Osamu Tomita <tomita@cinet.co.jp>
Subject: [PATCH 2.5.66] Janitor: misc_register() can fail, even in drivers/char/upd4990.c
Date: Mon, 31 Mar 2003 16:15:38 +0200 [thread overview]
Message-ID: <200303311615.38019.stephanm@muc.de> (raw)
--- linux-2.5.66/drivers/char/upd4990a.c~unmodified 2003-03-31 15:42:15.000000000 +0200
+++ linux-2.5.66/drivers/char/upd4990a.c 2003-03-31 16:05:15.000000000 +0200
@@ -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);
reply other threads:[~2003-03-31 14:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200303311615.38019.stephanm@muc.de \
--to=stephanm@muc.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tomita@cinet.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox