projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '85xx' into for_paulus
[powerpc.git]
/
arch
/
i386
/
kernel
/
hpet.c
diff --git
a/arch/i386/kernel/hpet.c
b/arch/i386/kernel/hpet.c
index
c6737c3
..
0b29d41
100644
(file)
--- a/
arch/i386/kernel/hpet.c
+++ b/
arch/i386/kernel/hpet.c
@@
-12,7
+12,7
@@
/* FSEC = 10^-15 NSEC = 10^-9 */
#define FSEC_PER_NSEC 1000000
/* FSEC = 10^-15 NSEC = 10^-9 */
#define FSEC_PER_NSEC 1000000
-static void *hpet_ptr;
+static void
__iomem
*hpet_ptr;
static cycle_t read_hpet(void)
{
static cycle_t read_hpet(void)
{
@@
-34,13
+34,13
@@
static int __init init_hpet_clocksource(void)
unsigned long hpet_period;
void __iomem* hpet_base;
u64 tmp;
unsigned long hpet_period;
void __iomem* hpet_base;
u64 tmp;
+ int err;
- if (!
hpet_address
)
+ if (!
is_hpet_enabled()
)
return -ENODEV;
/* calculate the hpet address: */
return -ENODEV;
/* calculate the hpet address: */
- hpet_base =
- (void __iomem*)ioremap_nocache(hpet_address, HPET_MMAP_SIZE);
+ hpet_base = ioremap_nocache(hpet_address, HPET_MMAP_SIZE);
hpet_ptr = hpet_base + HPET_COUNTER;
/* calculate the frequency: */
hpet_ptr = hpet_base + HPET_COUNTER;
/* calculate the frequency: */
@@
-61,7
+61,11
@@
static int __init init_hpet_clocksource(void)
do_div(tmp, FSEC_PER_NSEC);
clocksource_hpet.mult = (u32)tmp;
do_div(tmp, FSEC_PER_NSEC);
clocksource_hpet.mult = (u32)tmp;
- return clocksource_register(&clocksource_hpet);
+ err = clocksource_register(&clocksource_hpet);
+ if (err)
+ iounmap(hpet_base);
+
+ return err;
}
module_init(init_hpet_clocksource);
}
module_init(init_hpet_clocksource);