aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hpet.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/hpet.c')
-rw-r--r--drivers/char/hpet.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index a0a1829d3198..f8e7d89ceb2c 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -479,6 +479,21 @@ static int hpet_ioctl_ieon(struct hpet_dev *devp)
479 if (irq) { 479 if (irq) {
480 unsigned long irq_flags; 480 unsigned long irq_flags;
481 481
482 if (devp->hd_flags & HPET_SHARED_IRQ) {
483 /*
484 * To prevent the interrupt handler from seeing an
485 * unwanted interrupt status bit, program the timer
486 * so that it will not fire in the near future ...
487 */
488 writel(readl(&timer->hpet_config) & ~Tn_TYPE_CNF_MASK,
489 &timer->hpet_config);
490 write_counter(read_counter(&hpet->hpet_mc),
491 &timer->hpet_compare);
492 /* ... and clear any left-over status. */
493 isr = 1 << (devp - devp->hd_hpets->hp_dev);
494 writel(isr, &hpet->hpet_isr);
495 }
496
482 sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev)); 497 sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev));
483 irq_flags = devp->hd_flags & HPET_SHARED_IRQ 498 irq_flags = devp->hd_flags & HPET_SHARED_IRQ
484 ? IRQF_SHARED : IRQF_DISABLED; 499 ? IRQF_SHARED : IRQF_DISABLED;
@@ -970,6 +985,8 @@ static int hpet_acpi_add(struct acpi_device *device)
970 return -ENODEV; 985 return -ENODEV;
971 986
972 if (!data.hd_address || !data.hd_nirqs) { 987 if (!data.hd_address || !data.hd_nirqs) {
988 if (data.hd_address)
989 iounmap(data.hd_address);
973 printk("%s: no address or irqs in _CRS\n", __func__); 990 printk("%s: no address or irqs in _CRS\n", __func__);
974 return -ENODEV; 991 return -ENODEV;
975 } 992 }