diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-04-21 15:24:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-21 16:41:47 -0400 |
commit | 8e19608e8b5c001e4a66ce482edc474f05fb7355 (patch) | |
tree | 06af4be339136da7476396604c30112238d84339 /drivers | |
parent | ff14ed5db6e7e5e5dc23712d3c877891d4d9a1a8 (diff) |
clocksource: pass clocksource to read() callback
Pass clocksource pointer to the read() callback for clocksources. This
allows us to share the callback between multiple instances.
[hugh@veritas.com: fix powerpc build of clocksource pass clocksource mods]
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/hpet.c | 2 | ||||
-rw-r--r-- | drivers/clocksource/acpi_pm.c | 12 | ||||
-rw-r--r-- | drivers/clocksource/cyclone.c | 2 | ||||
-rw-r--r-- | drivers/clocksource/scx200_hrt.c | 2 | ||||
-rw-r--r-- | drivers/clocksource/tcb_clksrc.c | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 50dfa3bc71ce..340ba4f9dc54 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -72,7 +72,7 @@ static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ; | |||
72 | #ifdef CONFIG_IA64 | 72 | #ifdef CONFIG_IA64 |
73 | static void __iomem *hpet_mctr; | 73 | static void __iomem *hpet_mctr; |
74 | 74 | ||
75 | static cycle_t read_hpet(void) | 75 | static cycle_t read_hpet(struct clocksource *cs) |
76 | { | 76 | { |
77 | return (cycle_t)read_counter((void __iomem *)hpet_mctr); | 77 | return (cycle_t)read_counter((void __iomem *)hpet_mctr); |
78 | } | 78 | } |
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c index ee19b6e8fcb4..40bd8c61c7d7 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c | |||
@@ -57,7 +57,7 @@ u32 acpi_pm_read_verified(void) | |||
57 | return v2; | 57 | return v2; |
58 | } | 58 | } |
59 | 59 | ||
60 | static cycle_t acpi_pm_read(void) | 60 | static cycle_t acpi_pm_read(struct clocksource *cs) |
61 | { | 61 | { |
62 | return (cycle_t)read_pmtmr(); | 62 | return (cycle_t)read_pmtmr(); |
63 | } | 63 | } |
@@ -83,7 +83,7 @@ static int __init acpi_pm_good_setup(char *__str) | |||
83 | } | 83 | } |
84 | __setup("acpi_pm_good", acpi_pm_good_setup); | 84 | __setup("acpi_pm_good", acpi_pm_good_setup); |
85 | 85 | ||
86 | static cycle_t acpi_pm_read_slow(void) | 86 | static cycle_t acpi_pm_read_slow(struct clocksource *cs) |
87 | { | 87 | { |
88 | return (cycle_t)acpi_pm_read_verified(); | 88 | return (cycle_t)acpi_pm_read_verified(); |
89 | } | 89 | } |
@@ -156,9 +156,9 @@ static int verify_pmtmr_rate(void) | |||
156 | unsigned long count, delta; | 156 | unsigned long count, delta; |
157 | 157 | ||
158 | mach_prepare_counter(); | 158 | mach_prepare_counter(); |
159 | value1 = clocksource_acpi_pm.read(); | 159 | value1 = clocksource_acpi_pm.read(&clocksource_acpi_pm); |
160 | mach_countup(&count); | 160 | mach_countup(&count); |
161 | value2 = clocksource_acpi_pm.read(); | 161 | value2 = clocksource_acpi_pm.read(&clocksource_acpi_pm); |
162 | delta = (value2 - value1) & ACPI_PM_MASK; | 162 | delta = (value2 - value1) & ACPI_PM_MASK; |
163 | 163 | ||
164 | /* Check that the PMTMR delta is within 5% of what we expect */ | 164 | /* Check that the PMTMR delta is within 5% of what we expect */ |
@@ -195,9 +195,9 @@ static int __init init_acpi_pm_clocksource(void) | |||
195 | /* "verify" this timing source: */ | 195 | /* "verify" this timing source: */ |
196 | for (j = 0; j < ACPI_PM_MONOTONICITY_CHECKS; j++) { | 196 | for (j = 0; j < ACPI_PM_MONOTONICITY_CHECKS; j++) { |
197 | udelay(100 * j); | 197 | udelay(100 * j); |
198 | value1 = clocksource_acpi_pm.read(); | 198 | value1 = clocksource_acpi_pm.read(&clocksource_acpi_pm); |
199 | for (i = 0; i < ACPI_PM_READ_CHECKS; i++) { | 199 | for (i = 0; i < ACPI_PM_READ_CHECKS; i++) { |
200 | value2 = clocksource_acpi_pm.read(); | 200 | value2 = clocksource_acpi_pm.read(&clocksource_acpi_pm); |
201 | if (value2 == value1) | 201 | if (value2 == value1) |
202 | continue; | 202 | continue; |
203 | if (value2 > value1) | 203 | if (value2 > value1) |
diff --git a/drivers/clocksource/cyclone.c b/drivers/clocksource/cyclone.c index 8615059a8729..64e528e8bfa6 100644 --- a/drivers/clocksource/cyclone.c +++ b/drivers/clocksource/cyclone.c | |||
@@ -19,7 +19,7 @@ | |||
19 | int use_cyclone = 0; | 19 | int use_cyclone = 0; |
20 | static void __iomem *cyclone_ptr; | 20 | static void __iomem *cyclone_ptr; |
21 | 21 | ||
22 | static cycle_t read_cyclone(void) | 22 | static cycle_t read_cyclone(struct clocksource *cs) |
23 | { | 23 | { |
24 | return (cycle_t)readl(cyclone_ptr); | 24 | return (cycle_t)readl(cyclone_ptr); |
25 | } | 25 | } |
diff --git a/drivers/clocksource/scx200_hrt.c b/drivers/clocksource/scx200_hrt.c index b92da677aa5d..27f4d9637b62 100644 --- a/drivers/clocksource/scx200_hrt.c +++ b/drivers/clocksource/scx200_hrt.c | |||
@@ -43,7 +43,7 @@ MODULE_PARM_DESC(ppm, "+-adjust to actual XO freq (ppm)"); | |||
43 | /* The base timer frequency, * 27 if selected */ | 43 | /* The base timer frequency, * 27 if selected */ |
44 | #define HRT_FREQ 1000000 | 44 | #define HRT_FREQ 1000000 |
45 | 45 | ||
46 | static cycle_t read_hrt(void) | 46 | static cycle_t read_hrt(struct clocksource *cs) |
47 | { | 47 | { |
48 | /* Read the timer value */ | 48 | /* Read the timer value */ |
49 | return (cycle_t) inl(scx200_cb_base + SCx200_TIMER_OFFSET); | 49 | return (cycle_t) inl(scx200_cb_base + SCx200_TIMER_OFFSET); |
diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index 254f1064d973..01b886e68822 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c | |||
@@ -39,7 +39,7 @@ | |||
39 | 39 | ||
40 | static void __iomem *tcaddr; | 40 | static void __iomem *tcaddr; |
41 | 41 | ||
42 | static cycle_t tc_get_cycles(void) | 42 | static cycle_t tc_get_cycles(struct clocksource *cs) |
43 | { | 43 | { |
44 | unsigned long flags; | 44 | unsigned long flags; |
45 | u32 lower, upper; | 45 | u32 lower, upper; |