summaryrefslogtreecommitdiff
path: root/include/linux/of_net.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-03-09 23:50:26 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-09 23:50:26 -0400
commitbf0b211256be342e92d3ee5c5a1fb8d42f3928bb (patch)
tree3e57589f3c8b06b02e895e2428a82433f5cb8bda /include/linux/of_net.h
parent3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14 (diff)
parent769a020289bc8f68b7e48faf8fee970346d71a3b (diff)
Merge branch 'dsa-next'
Florian Fainelli says: ==================== net: dsa: remove restriction on platform_device This patch series removes the restriction in DSA to operate exclusively with platform_device Ethernet MAC drivers when using Device Tree. This basically allows arbitrary Ethernet MAC drivers to be used now in conjunction with Device Tree. The reason was that DSA was using a of_find_device_by_node() which limits the device_node to device pointer search exclusively to platform_device, in our case, we are interested in doing a "class" research and lookup the net_device. Thanks to Chris Packham for testing this on his platform. Changes in v2: - fix build for !CONFIG_OF_NET ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/of_net.h')
-rw-r--r--include/linux/of_net.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/of_net.h b/include/linux/of_net.h
index 34597c8c1a4c..9cd72aab76fe 100644
--- a/include/linux/of_net.h
+++ b/include/linux/of_net.h
@@ -9,8 +9,11 @@
#ifdef CONFIG_OF_NET
#include <linux/of.h>
+
+struct net_device;
extern int of_get_phy_mode(struct device_node *np);
extern const void *of_get_mac_address(struct device_node *np);
+extern struct net_device *of_find_net_device_by_node(struct device_node *np);
#else
static inline int of_get_phy_mode(struct device_node *np)
{
@@ -21,6 +24,11 @@ static inline const void *of_get_mac_address(struct device_node *np)
{
return NULL;
}
+
+static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
+{
+ return NULL;
+}
#endif
#endif /* __LINUX_OF_NET_H */