blob: 18becf5c648022c10692830fa3dd8e36709c6de0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#ifndef _BP_OF_NET_H
#define _BP_OF_NET_H
#include_next <linux/of_net.h>
#include <linux/version.h>
#ifndef CONFIG_OF
#if LINUX_VERSION_IS_LESS(3,10,0)
static inline const void *of_get_mac_address(struct device_node *np)
{
return NULL;
}
#endif
#endif
/* The behavior of of_get_mac_address() changed in kernel 5.2, it now
* returns an error code and not NULL in case of an error.
*/
#if LINUX_VERSION_IS_LESS(5,2,0)
static inline const void *backport_of_get_mac_address(struct device_node *np)
{
const void *mac = of_get_mac_address(np);
if (!mac)
return ERR_PTR(-ENODEV);
return mac;
}
#define of_get_mac_address LINUX_BACKPORT(of_get_mac_address)
#endif /* < 5.2 */
#endif /* _BP_OF_NET_H */
|