diff mbox series

[09/31] net: Drop dm.h header file from phy.h

Message ID 20200719161601.495421-10-sjg@chromium.org
State Accepted
Delegated to: Tom Rini
Headers show
Series dm: Avoid including dm.h in header files | expand

Commit Message

Simon Glass July 19, 2020, 4:15 p.m. UTC
This header file should not be included in other header files. Remove it
and use other headers and C inclusions instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 cmd/mdio.c              | 1 +
 cmd/mii.c               | 1 +
 include/dm/read.h       | 1 +
 include/phy.h           | 9 ++++++---
 include/phy_interface.h | 2 ++
 net/eth_legacy.c        | 1 +
 6 files changed, 12 insertions(+), 3 deletions(-)

Comments

Tom Rini Aug. 4, 2020, 3:04 p.m. UTC | #1
On Sun, Jul 19, 2020 at 10:15:39AM -0600, Simon Glass wrote:

> This header file should not be included in other header files. Remove it
> and use other headers and C inclusions instead.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/cmd/mdio.c b/cmd/mdio.c
index c48bb51237..cfa45ad12a 100644
--- a/cmd/mdio.c
+++ b/cmd/mdio.c
@@ -10,6 +10,7 @@ 
 
 #include <common.h>
 #include <command.h>
+#include <dm.h>
 #include <miiphy.h>
 #include <phy.h>
 
diff --git a/cmd/mii.c b/cmd/mii.c
index b52a55dc33..fe8602eb7c 100644
--- a/cmd/mii.c
+++ b/cmd/mii.c
@@ -10,6 +10,7 @@ 
 
 #include <common.h>
 #include <command.h>
+#include <dm.h>
 #include <miiphy.h>
 
 typedef struct _MII_field_desc_t {
diff --git a/include/dm/read.h b/include/dm/read.h
index f02ec95954..5c34a0ffab 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -9,6 +9,7 @@ 
 #ifndef _DM_READ_H
 #define _DM_READ_H
 
+#include <dm/device.h>
 #include <dm/fdtaddr.h>
 #include <dm/ofnode.h>
 #include <dm/uclass.h>
diff --git a/include/phy.h b/include/phy.h
index fedd146091..1dbbf65111 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -9,14 +9,17 @@ 
 #ifndef _PHY_H
 #define _PHY_H
 
-#include <dm.h>
+#include <log.h>
+#include <phy_interface.h>
+#include <dm/ofnode.h>
+#include <dm/read.h>
 #include <linux/errno.h>
 #include <linux/list.h>
 #include <linux/mii.h>
 #include <linux/ethtool.h>
 #include <linux/mdio.h>
-#include <log.h>
-#include <phy_interface.h>
+
+struct udevice;
 
 #define PHY_FIXED_ID		0xa5a55a5a
 #define PHY_NCSI_ID            0xbeefcafe
diff --git a/include/phy_interface.h b/include/phy_interface.h
index 882e4af8ff..841ade311e 100644
--- a/include/phy_interface.h
+++ b/include/phy_interface.h
@@ -10,6 +10,8 @@ 
 #ifndef _PHY_INTERFACE_H
 #define _PHY_INTERFACE_H
 
+#include <string.h>
+
 typedef enum {
 	PHY_INTERFACE_MODE_MII,
 	PHY_INTERFACE_MODE_GMII,
diff --git a/net/eth_legacy.c b/net/eth_legacy.c
index 340469ba3a..992d1880bf 100644
--- a/net/eth_legacy.c
+++ b/net/eth_legacy.c
@@ -8,6 +8,7 @@ 
 #include <common.h>
 #include <bootstage.h>
 #include <command.h>
+#include <dm.h>
 #include <env.h>
 #include <log.h>
 #include <net.h>