blob: 0f0346e6829c054dac1ca52be75c3e160bf9152d [file] [log] [blame]
David Daney4b6ba8a2010-10-26 15:07:13 -07001/*
2 * OF helpers for network devices.
3 *
4 * This file is released under the GPLv2
5 */
6
7#ifndef __LINUX_OF_NET_H
8#define __LINUX_OF_NET_H
9
10#ifdef CONFIG_OF_NET
11#include <linux/of.h>
Florian Fainelliaa836df2015-03-09 14:31:20 -070012
13struct net_device;
Geert Uytterhoeven7e0bdf12013-08-18 13:01:30 +020014extern int of_get_phy_mode(struct device_node *np);
David Daney4b6ba8a2010-10-26 15:07:13 -070015extern const void *of_get_mac_address(struct device_node *np);
Florian Fainelliaa836df2015-03-09 14:31:20 -070016extern struct net_device *of_find_net_device_by_node(struct device_node *np);
Guenter Roeck65b3841b2013-04-02 09:35:07 +000017#else
Geert Uytterhoeven7e0bdf12013-08-18 13:01:30 +020018static inline int of_get_phy_mode(struct device_node *np)
Guenter Roeck65b3841b2013-04-02 09:35:07 +000019{
20 return -ENODEV;
21}
22
23static inline const void *of_get_mac_address(struct device_node *np)
24{
Petr Štetiar6a0a9232019-05-19 14:18:44 +020025 return ERR_PTR(-ENODEV);
Guenter Roeck65b3841b2013-04-02 09:35:07 +000026}
Florian Fainelliaa836df2015-03-09 14:31:20 -070027
28static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
29{
30 return NULL;
31}
David Daney4b6ba8a2010-10-26 15:07:13 -070032#endif
33
34#endif /* __LINUX_OF_NET_H */