summaryrefslogtreecommitdiff
path: root/drivers/char/hpet.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2014-04-07 23:49:35 (GMT)
committerScott Wood <scottwood@freescale.com>2014-04-07 23:49:35 (GMT)
commit62b8c978ee6b8d135d9e7953221de58000dba986 (patch)
tree683b04b2e627f6710c22c151b23c8cc9a165315e /drivers/char/hpet.c
parent78fd82238d0e5716578c326404184a27ba67fd6e (diff)
downloadlinux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'drivers/char/hpet.c')
-rw-r--r--drivers/char/hpet.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 5d9c31d..448ce5e 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -367,29 +367,12 @@ static unsigned int hpet_poll(struct file *file, poll_table * wait)
return 0;
}
-#ifdef CONFIG_HPET_MMAP
-#ifdef CONFIG_HPET_MMAP_DEFAULT
-static int hpet_mmap_enabled = 1;
-#else
-static int hpet_mmap_enabled = 0;
-#endif
-
-static __init int hpet_mmap_enable(char *str)
-{
- get_option(&str, &hpet_mmap_enabled);
- pr_info("HPET mmap %s\n", hpet_mmap_enabled ? "enabled" : "disabled");
- return 1;
-}
-__setup("hpet_mmap", hpet_mmap_enable);
-
static int hpet_mmap(struct file *file, struct vm_area_struct *vma)
{
+#ifdef CONFIG_HPET_MMAP
struct hpet_dev *devp;
unsigned long addr;
- if (!hpet_mmap_enabled)
- return -EACCES;
-
devp = file->private_data;
addr = devp->hd_hpets->hp_hpet_phys;
@@ -398,13 +381,10 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma)
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
return vm_iomap_memory(vma, addr, PAGE_SIZE);
-}
#else
-static int hpet_mmap(struct file *file, struct vm_area_struct *vma)
-{
return -ENOSYS;
-}
#endif
+}
static int hpet_fasync(int fd, struct file *file, int on)
{
@@ -506,7 +486,8 @@ static int hpet_ioctl_ieon(struct hpet_dev *devp)
}
sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev));
- irq_flags = devp->hd_flags & HPET_SHARED_IRQ ? IRQF_SHARED : 0;
+ irq_flags = devp->hd_flags & HPET_SHARED_IRQ
+ ? IRQF_SHARED : IRQF_DISABLED;
if (request_irq(irq, hpet_interrupt, irq_flags,
devp->hd_name, (void *)devp)) {
printk(KERN_ERR "hpet: IRQ %d is not free\n", irq);
@@ -990,6 +971,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
struct acpi_resource_fixed_memory32 *fixmem32;
fixmem32 = &res->data.fixed_memory32;
+ if (!fixmem32)
+ return AE_NO_MEMORY;
hdp->hd_phys_address = fixmem32->address;
hdp->hd_address = ioremap(fixmem32->address,