Skip to content

Commit e44252f

Browse files
committed
x86/hpet: Use channel for legacy clockevent storage
All preparations are done. Use the channel storage for the legacy clockevent and remove the static variable. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ricardo Neri <[email protected]> Cc: Ashok Raj <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Suravee Suthikulpanit <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Ravi Shankar <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 49adaa6 commit e44252f

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

arch/x86/kernel/hpet.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ bool boot_hpet_disable;
6666
bool hpet_force_user;
6767
static bool hpet_verbose;
6868

69-
/*
70-
* The HPET clock event device wrapped in a channel for conversion
71-
*/
72-
static struct hpet_channel hpet_channel0;
73-
7469
static inline
7570
struct hpet_channel *clockevent_to_channel(struct clock_event_device *evt)
7671
{
@@ -904,7 +899,7 @@ int __init hpet_enable(void)
904899
clocksource_register_hz(&clocksource_hpet, (u32)hpet_freq);
905900

906901
if (id & HPET_ID_LEGSUP) {
907-
hpet_legacy_clockevent_register(&hpet_channel0);
902+
hpet_legacy_clockevent_register(&hpet_base.channels[0]);
908903
hpet_base.channels[0].mode = HPET_MODE_LEGACY;
909904
if (IS_ENABLED(CONFIG_HPET_EMULATE_RTC))
910905
hpet_base.channels[1].mode = HPET_MODE_LEGACY;
@@ -1089,7 +1084,7 @@ int hpet_rtc_timer_init(void)
10891084
return 0;
10901085

10911086
if (!hpet_default_delta) {
1092-
struct clock_event_device *evt = &hpet_channel0.evt;
1087+
struct clock_event_device *evt = &hpet_base.channels[0].evt;
10931088
uint64_t clc;
10941089

10951090
clc = (uint64_t) evt->mult * NSEC_PER_SEC;
@@ -1187,7 +1182,7 @@ int hpet_set_periodic_freq(unsigned long freq)
11871182
if (freq <= DEFAULT_RTC_INT_FREQ) {
11881183
hpet_pie_limit = DEFAULT_RTC_INT_FREQ / freq;
11891184
} else {
1190-
struct clock_event_device *evt = &hpet_channel0.evt;
1185+
struct clock_event_device *evt = &hpet_base.channels[0].evt;
11911186

11921187
clc = (uint64_t) evt->mult * NSEC_PER_SEC;
11931188
do_div(clc, freq);

0 commit comments

Comments
 (0)