aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/clocksource.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r--include/linux/clocksource.h12
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
333extern int clocksource_i8253_init(void); 333extern int clocksource_i8253_init(void);
334 334
335struct device_node;
336typedef void(*clocksource_of_init_fn)(struct device_node *);
335#ifdef CONFIG_CLKSRC_OF 337#ifdef CONFIG_CLKSRC_OF
336extern void clocksource_of_init(void); 338extern 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) 346static 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 */