Message ID | 20200719161601.495421-11-sjg@chromium.org |
---|---|
State | Accepted |
Commit | a00867b47a4be848c400f74b97479193a41d327c |
Delegated to: | Tom Rini |
Headers | show |
Series | dm: Avoid including dm.h in header files | expand |
On Sun, Jul 19, 2020 at 10:15:40AM -0600, Simon Glass wrote: > 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> Applied to u-boot/master, thanks!
diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c index 513be09c68..96be069ee8 100644 --- a/arch/arm/mach-k3/sysfw-loader.c +++ b/arch/arm/mach-k3/sysfw-loader.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <dm.h> #include <image.h> #include <log.h> #include <spl.h> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c index 70940f01f3..8aad4be467 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <dm.h> #include <dfu.h> #include <malloc.h> #include <serial.h> diff --git a/arch/x86/cpu/ivybridge/sdram.c b/arch/x86/cpu/ivybridge/sdram.c index 99bc48021e..dd6b8753de 100644 --- a/arch/x86/cpu/ivybridge/sdram.c +++ b/arch/x86/cpu/ivybridge/sdram.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <dm.h> #include <errno.h> #include <fdtdec.h> #include <init.h> diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c index 0cda9196f9..38eb0f27c9 100644 --- a/board/st/common/stm32mp_dfu.c +++ b/board/st/common/stm32mp_dfu.c @@ -5,6 +5,7 @@ #include <common.h> #include <blk.h> +#include <dm.h> #include <dfu.h> #include <env.h> #include <memalign.h> diff --git a/include/spi_flash.h b/include/spi_flash.h index b336619487..85cae32cc7 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -9,10 +9,11 @@ #ifndef _SPI_FLASH_H_ #define _SPI_FLASH_H_ -#include <dm.h> /* Because we dereference struct udevice here */ #include <linux/types.h> #include <linux/mtd/spi-nor.h> +struct udevice; + /* by default ENV use the same parameters than SF command */ #ifndef CONFIG_ENV_SPI_BUS # define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
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> --- arch/arm/mach-k3/sysfw-loader.c | 1 + arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c | 1 + arch/x86/cpu/ivybridge/sdram.c | 1 + board/st/common/stm32mp_dfu.c | 1 + include/spi_flash.h | 3 ++- 5 files changed, 6 insertions(+), 1 deletion(-)