Add a macro of_match_ptr() that allows the .of_match_table entry in the driver structures to be assigned without having an #ifdef xxx NULL for the case that OF is not enabled
Signed-off-by: Ben Dooks <[email protected]> --- include/linux/of.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/of.h b/include/linux/of.h index bd716f8..951e87b 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -234,6 +234,7 @@ extern void of_attach_node(struct device_node *); extern void of_detach_node(struct device_node *); #endif +#define of_match_ptr(_ptr) (_ptr) #else /* CONFIG_OF */ static inline bool of_have_populated_dt(void) @@ -253,6 +254,7 @@ static inline int of_property_read_string(struct device_node *np, return -ENOSYS; } +#define of_match_ptr(_ptr) NULL #endif /* CONFIG_OF */ static inline int of_property_read_u32(const struct device_node *np, -- 1.7.1 _______________________________________________ devicetree-discuss mailing list [email protected] https://lists.ozlabs.org/listinfo/devicetree-discuss
