Browse Source

mtd: spi-mem: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass 3 years ago
parent
commit
340fd10e7b
4 changed files with 10 additions and 5 deletions
  1. 6 1
      drivers/spi/spi-mem.c
  2. 1 0
      drivers/spi/spi-sifive.c
  3. 2 0
      drivers/spi/stm32_qspi.c
  4. 1 4
      include/spi-mem.h

+ 6 - 1
drivers/spi/spi-mem.c

@@ -13,9 +13,14 @@
 #include <linux/pm_runtime.h>
 #include "internals.h"
 #else
-#include <dm/device_compat.h>
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <malloc.h>
+#include <spi.h>
 #include <spi.h>
 #include <spi-mem.h>
+#include <dm/device_compat.h>
 #endif
 
 #ifndef __UBOOT__

+ 1 - 0
drivers/spi/spi-sifive.c

@@ -10,6 +10,7 @@
 #include <dm.h>
 #include <dm/device_compat.h>
 #include <malloc.h>
+#include <spi.h>
 #include <spi-mem.h>
 #include <wait_bit.h>
 #include <asm/io.h>

+ 2 - 0
drivers/spi/stm32_qspi.c

@@ -9,8 +9,10 @@
 
 #include <common.h>
 #include <clk.h>
+#include <dm.h>
 #include <log.h>
 #include <reset.h>
+#include <spi.h>
 #include <spi-mem.h>
 #include <dm/device_compat.h>
 #include <linux/bitops.h>

+ 1 - 4
include/spi-mem.h

@@ -11,10 +11,7 @@
 #ifndef __UBOOT_SPI_MEM_H
 #define __UBOOT_SPI_MEM_H
 
-#include <common.h>
-#include <dm.h>
-#include <errno.h>
-#include <spi.h>
+struct udevice;
 
 #define SPI_MEM_OP_CMD(__opcode, __buswidth)			\
 	{							\