diff options
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r-- | include/linux/clocksource.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 27cfda427dd9..192d6d1771ee 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -332,15 +332,23 @@ extern int clocksource_mmio_init(void __iomem *, const char *, | |||
332 | 332 | ||
333 | extern int clocksource_i8253_init(void); | 333 | extern int clocksource_i8253_init(void); |
334 | 334 | ||
335 | struct device_node; | ||
336 | typedef void(*clocksource_of_init_fn)(struct device_node *); | ||
335 | #ifdef CONFIG_CLKSRC_OF | 337 | #ifdef CONFIG_CLKSRC_OF |
336 | extern void clocksource_of_init(void); | 338 | extern void clocksource_of_init(void); |
337 | 339 | ||
338 | #define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \ | 340 | #define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \ |
339 | static const struct of_device_id __clksrc_of_table_##name \ | 341 | static const struct of_device_id __clksrc_of_table_##name \ |
340 | __used __section(__clksrc_of_table) \ | 342 | __used __section(__clksrc_of_table) \ |
341 | = { .compatible = compat, .data = fn }; | 343 | = { .compatible = compat, \ |
344 | .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn } | ||
342 | #else | 345 | #else |
343 | #define CLOCKSOURCE_OF_DECLARE(name, compat, fn) | 346 | static inline void clocksource_of_init(void) {} |
347 | #define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \ | ||
348 | static const struct of_device_id __clksrc_of_table_##name \ | ||
349 | __attribute__((unused)) \ | ||
350 | = { .compatible = compat, \ | ||
351 | .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn } | ||
344 | #endif | 352 | #endif |
345 | 353 | ||
346 | #endif /* _LINUX_CLOCKSOURCE_H */ | 354 | #endif /* _LINUX_CLOCKSOURCE_H */ |