blob: 6aeaea1775e66219b8d7b200ed1f2370a7a908e5 [file] [log] [blame]
Thomas Gleixner55716d22019-06-01 10:08:42 +02001/* SPDX-License-Identifier: GPL-2.0-only */
David Daney4b6ba8a2010-10-26 15:07:13 -07002/*
3 * OF helpers for network devices.
David Daney4b6ba8a2010-10-26 15:07:13 -07004 */
5
6#ifndef __LINUX_OF_NET_H
7#define __LINUX_OF_NET_H
8
9#ifdef CONFIG_OF_NET
10#include <linux/of.h>
Florian Fainelliaa836df2015-03-09 14:31:20 -070011
12struct net_device;
Geert Uytterhoeven7e0bdf12013-08-18 13:01:30 +020013extern int of_get_phy_mode(struct device_node *np);
David Daney4b6ba8a2010-10-26 15:07:13 -070014extern const void *of_get_mac_address(struct device_node *np);
Florian Fainelliaa836df2015-03-09 14:31:20 -070015extern struct net_device *of_find_net_device_by_node(struct device_node *np);
Guenter Roeck65b3841b2013-04-02 09:35:07 +000016#else
Geert Uytterhoeven7e0bdf12013-08-18 13:01:30 +020017static inline int of_get_phy_mode(struct device_node *np)
Guenter Roeck65b3841b2013-04-02 09:35:07 +000018{
19 return -ENODEV;
20}
21
22static inline const void *of_get_mac_address(struct device_node *np)
23{
Petr Štetiar6a0a9232019-05-19 14:18:44 +020024 return ERR_PTR(-ENODEV);
Guenter Roeck65b3841b2013-04-02 09:35:07 +000025}
Florian Fainelliaa836df2015-03-09 14:31:20 -070026
27static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
28{
29 return NULL;
30}
David Daney4b6ba8a2010-10-26 15:07:13 -070031#endif
32
33#endif /* __LINUX_OF_NET_H */