Merge pull request #580 from wigyori/cc-libpcap
[15.05/openwrt.git] / target / linux / brcm63xx / patches-3.18 / 371_add_of_node_available_by_alias.patch
1 --- a/arch/mips/bcm63xx/boards/board_common.c
2 +++ b/arch/mips/bcm63xx/boards/board_common.c
3 @@ -147,6 +147,18 @@ void __init device_tree_init(void)
4  
5         unflatten_and_copy_device_tree();
6  }
7 +
8 +int board_of_device_present(const char *alias)
9 +{
10 +       bool present;
11 +       struct device_node *np;
12 +
13 +       np = of_find_node_by_path(alias);
14 +       present = of_device_is_available(np);
15 +       of_node_put(np);
16 +
17 +       return present;
18 +}
19  #endif
20  
21  static struct gpio_led_platform_data bcm63xx_led_data;
22 --- a/arch/mips/bcm63xx/boards/board_common.h
23 +++ b/arch/mips/bcm63xx/boards/board_common.h
24 @@ -15,4 +15,13 @@ void board_bcm963xx_init(void);
25  static inline void board_bcm963xx_init(void) { }
26  #endif
27  
28 +#if defined(CONFIG_OF)
29 +int board_of_device_present(const char *alias);
30 +#else
31 +static inline void board_of_device_present(const char *alias)
32 +{
33 +       return 0;
34 +}
35 +#endif
36 +
37  #endif /* __BOARD_COMMON_H */