]> git.hungrycats.org Git - linux/commitdiff
request_region janitor cleanup for rtc char driver
authorWilliam Stinson <wstinson@infonie.fr>
Sat, 11 May 2002 10:26:33 +0000 (06:26 -0400)
committerJeff Garzik <jgarzik@mandrakesoft.com>
Sat, 11 May 2002 10:26:33 +0000 (06:26 -0400)
drivers/char/rtc.c

index 006e0c3d2c3dc166ac68531cf2a7810a6de44aaa..d242af3286ad1a78031d44ec2df278eafdb835d9 100644 (file)
@@ -815,7 +815,7 @@ found:
        }
 no_irq:
 #else
-       if (check_region (RTC_PORT (0), RTC_IO_EXTENT))
+       if (!request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"))
        {
                printk(KERN_ERR "rtc: I/O port %d is not free.\n", RTC_PORT (0));
                return -EIO;
@@ -826,11 +826,11 @@ no_irq:
        {
                /* Yeah right, seeing as irq 8 doesn't even hit the bus. */
                printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
+               release_region(RTC_PORT(0), RTC_IO_EXTENT);
                return -EIO;
        }
 #endif
 
-       request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
 #endif /* __sparc__ vs. others */
 
        misc_register(&rtc_dev);