[U-Boot] [PATCH 07/30] mtd: spi-mem: Drop dm.h header file
Simon Glass
sjg at chromium.org
Sun Oct 27 15:53:47 UTC 2019
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 at chromium.org>
---
drivers/spi/spi-mem-nodm.c | 1 +
drivers/spi/spi-mem.c | 5 +++++
drivers/spi/stm32_qspi.c | 2 ++
include/spi-mem.h | 5 +----
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-mem-nodm.c b/drivers/spi/spi-mem-nodm.c
index 4447d44991..83dde4806e 100644
--- a/drivers/spi/spi-mem-nodm.c
+++ b/drivers/spi/spi-mem-nodm.c
@@ -3,6 +3,7 @@
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
*/
+#include <malloc.h>
#include <spi.h>
#include <spi-mem.h>
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 7788ab9953..e5a8109058 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -11,6 +11,11 @@
#include <linux/pm_runtime.h>
#include "internals.h"
#else
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <malloc.h>
+#include <spi.h>
#include <spi.h>
#include <spi-mem.h>
#endif
diff --git a/drivers/spi/stm32_qspi.c b/drivers/spi/stm32_qspi.c
index 958c394a1a..c8c81396c5 100644
--- a/drivers/spi/stm32_qspi.c
+++ b/drivers/spi/stm32_qspi.c
@@ -9,7 +9,9 @@
#include <common.h>
#include <clk.h>
+#include <dm.h>
#include <reset.h>
+#include <spi.h>
#include <spi-mem.h>
#include <linux/iopoll.h>
#include <linux/ioport.h>
diff --git a/include/spi-mem.h b/include/spi-mem.h
index 36814efa86..2f3f0156d0 100644
--- a/include/spi-mem.h
+++ b/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) \
{ \
--
2.24.0.rc0.303.g954a862665-goog
More information about the U-Boot
mailing list