Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73710
b: refs/heads/master
c: 4c06be1
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Nov 15, 2007
1 parent 6933622 commit db8cd9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c06a018fa5362fa9ed0768bd747c0fab26bc8849
refs/heads/master: 4c06be10c790008aa2b2d19df2872ff39990b7bd
20 changes: 11 additions & 9 deletions trunk/drivers/char/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,14 @@ static const struct file_operations rtc_proc_fops = {
};
#endif

static void rtc_release_region(void)
{
if (RTC_IOMAPPED)
release_region(RTC_PORT(0), RTC_IO_EXTENT);
else
release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
}

static int __init rtc_init(void)
{
#ifdef CONFIG_PROC_FS
Expand Down Expand Up @@ -992,10 +1000,7 @@ static int __init rtc_init(void)
/* Yeah right, seeing as irq 8 doesn't even hit the bus. */
rtc_has_irq = 0;
printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
if (RTC_IOMAPPED)
release_region(RTC_PORT(0), RTC_IO_EXTENT);
else
release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
rtc_release_region();
return -EIO;
}
hpet_rtc_timer_init();
Expand All @@ -1009,7 +1014,7 @@ static int __init rtc_init(void)
free_irq(RTC_IRQ, NULL);
rtc_has_irq = 0;
#endif
release_region(RTC_PORT(0), RTC_IO_EXTENT);
rtc_release_region();
return -ENODEV;
}

Expand Down Expand Up @@ -1091,10 +1096,7 @@ static void __exit rtc_exit (void)
if (rtc_has_irq)
free_irq (rtc_irq, &rtc_port);
#else
if (RTC_IOMAPPED)
release_region(RTC_PORT(0), RTC_IO_EXTENT);
else
release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
rtc_release_region();
#ifdef RTC_IRQ
if (rtc_has_irq)
free_irq (RTC_IRQ, NULL);
Expand Down

0 comments on commit db8cd9e

Please sign in to comment.