Skip to content

Commit

Permalink
OF: Add of_match_ptr() macro
Browse files Browse the repository at this point in the history
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 <ben-linux@fluff.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Ben Dooks authored and Grant Likely committed Sep 30, 2011
1 parent aba3dff commit 3a1e362
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/of.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,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)
Expand Down Expand Up @@ -280,6 +281,7 @@ static inline const void *of_get_property(const struct device_node *node,
return NULL;
}

#define of_match_ptr(_ptr) NULL
#endif /* CONFIG_OF */

static inline int of_property_read_u32(const struct device_node *np,
Expand Down

0 comments on commit 3a1e362

Please sign in to comment.