2019-06-01 16:08:42 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2010-10-27 06:07:13 +08:00
|
|
|
/*
|
|
|
|
* OF helpers for network devices.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_OF_NET_H
|
|
|
|
#define __LINUX_OF_NET_H
|
|
|
|
|
|
|
|
#ifdef CONFIG_OF_NET
|
|
|
|
#include <linux/of.h>
|
2015-03-10 05:31:20 +08:00
|
|
|
|
|
|
|
struct net_device;
|
2013-08-18 19:01:30 +08:00
|
|
|
extern int of_get_phy_mode(struct device_node *np);
|
2010-10-27 06:07:13 +08:00
|
|
|
extern const void *of_get_mac_address(struct device_node *np);
|
2015-03-10 05:31:20 +08:00
|
|
|
extern struct net_device *of_find_net_device_by_node(struct device_node *np);
|
2013-04-02 17:35:07 +08:00
|
|
|
#else
|
2013-08-18 19:01:30 +08:00
|
|
|
static inline int of_get_phy_mode(struct device_node *np)
|
2013-04-02 17:35:07 +08:00
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline const void *of_get_mac_address(struct device_node *np)
|
|
|
|
{
|
2019-05-19 20:18:44 +08:00
|
|
|
return ERR_PTR(-ENODEV);
|
2013-04-02 17:35:07 +08:00
|
|
|
}
|
2015-03-10 05:31:20 +08:00
|
|
|
|
|
|
|
static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2010-10-27 06:07:13 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __LINUX_OF_NET_H */
|