summaryrefslogtreecommitdiffstats
path: root/include/linux/clocksource.h
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2014-05-08 16:09:24 -0500
committerRob Herring <robh@kernel.org>2014-05-20 14:25:24 -0500
commit54196ccbe0ba1f268a646059473313589db35b01 (patch)
tree07443c68af484b0a74ce8456e58f97342f95cf25 /include/linux/clocksource.h
parent826d8958419ae924ae2af12d214ee599ee713e91 (diff)
downloadblackbird-op-linux-54196ccbe0ba1f268a646059473313589db35b01.tar.gz
blackbird-op-linux-54196ccbe0ba1f268a646059473313589db35b01.zip
of: consolidate linker section OF match table declarations
We now have several OF match tables using linker sections that are nearly the same definition. The only variation is the callback function prototype. Create a common define for creating linker section OF match table entries which each table declaration can use. Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r--include/linux/clocksource.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 67301a405712..a16b497d5159 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -339,23 +339,13 @@ extern int clocksource_mmio_init(void __iomem *, const char *,
extern int clocksource_i8253_init(void);
-struct device_node;
-typedef void(*clocksource_of_init_fn)(struct device_node *);
+#define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \
+ OF_DECLARE_1(clksrc, name, compat, fn)
+
#ifdef CONFIG_CLKSRC_OF
extern void clocksource_of_init(void);
-
-#define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \
- static const struct of_device_id __clksrc_of_table_##name \
- __used __section(__clksrc_of_table) \
- = { .compatible = compat, \
- .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn }
#else
static inline void clocksource_of_init(void) {}
-#define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \
- static const struct of_device_id __clksrc_of_table_##name \
- __attribute__((unused)) \
- = { .compatible = compat, \
- .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn }
#endif
#endif /* _LINUX_CLOCKSOURCE_H */
OpenPOWER on IntegriCloud