From defce58181e962f9c9979091ac4726cfcded63e7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:33 -0600 Subject: wdt: Drop dm.h header file This header file should not be included in other header files. Remove it and use a forward declaration instead. Also remove the other headers that are not needed, since the inline code was removed in a recent commit: b4d9452c4 ("watchdog: move initr_watchdog() to wdt-uclass.c") Signed-off-by: Simon Glass --- include/wdt.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/wdt.h b/include/wdt.h index d2ccfbc62ef..bc242c2eb26 100644 --- a/include/wdt.h +++ b/include/wdt.h @@ -6,9 +6,7 @@ #ifndef _WDT_H_ #define _WDT_H_ -#include -#include -#include +struct udevice; /* * Implement a simple watchdog uclass. Watchdog is basically a timer that -- cgit v1.3.1 From 340fd10e7b235681fe5996a89cc84dfcd5afafbd Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:34 -0600 Subject: 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 --- drivers/spi/spi-mem.c | 7 ++++++- drivers/spi/spi-sifive.c | 1 + drivers/spi/stm32_qspi.c | 2 ++ include/spi-mem.h | 5 +---- 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index d344701aebb..c095ae9505a 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -13,9 +13,14 @@ #include #include "internals.h" #else -#include +#include +#include +#include +#include +#include #include #include +#include #endif #ifndef __UBOOT__ diff --git a/drivers/spi/spi-sifive.c b/drivers/spi/spi-sifive.c index 0e0ce25abb9..c7345d90428 100644 --- a/drivers/spi/spi-sifive.c +++ b/drivers/spi/spi-sifive.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/spi/stm32_qspi.c b/drivers/spi/stm32_qspi.c index 001f0703e3c..a53b941410d 100644 --- a/drivers/spi/stm32_qspi.c +++ b/drivers/spi/stm32_qspi.c @@ -9,8 +9,10 @@ #include #include +#include #include #include +#include #include #include #include diff --git a/include/spi-mem.h b/include/spi-mem.h index 893f7bd7337..ca0f55c8fdf 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 -#include -#include -#include +struct udevice; #define SPI_MEM_OP_CMD(__opcode, __buswidth) \ { \ -- cgit v1.3.1 From 54234592df3324cdb6013d8c94013a2982dd660e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:35 -0600 Subject: mtd: spi: Drop SPI_XFER_MMAP* These two defines are no-longer supported. Drop them. Signed-off-by: Simon Glass --- include/spi.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/spi.h b/include/spi.h index 98ba9e796d5..ef8c1f6692e 100644 --- a/include/spi.h +++ b/include/spi.h @@ -146,8 +146,6 @@ struct spi_slave { #define SPI_XFER_BEGIN BIT(0) /* Assert CS before transfer */ #define SPI_XFER_END BIT(1) /* Deassert CS after transfer */ #define SPI_XFER_ONCE (SPI_XFER_BEGIN | SPI_XFER_END) -#define SPI_XFER_MMAP BIT(2) /* Memory Mapped start */ -#define SPI_XFER_MMAP_END BIT(3) /* Memory Mapped End */ }; /** -- cgit v1.3.1 From 82a7697b5ab3327d76cba884e10ac603aadac68c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:36 -0600 Subject: dm: core: Drop dm.h header file from dm-demo.h This header file should not be included in other header files. Remove it and add it to the cmd file instead. Signed-off-by: Simon Glass --- cmd/demo.c | 1 + include/dm-demo.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/cmd/demo.c b/cmd/demo.c index 9da06f5e4d3..f923533f794 100644 --- a/cmd/demo.c +++ b/cmd/demo.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/include/dm-demo.h b/include/dm-demo.h index c9a82c7e52c..7b6d0d80ff8 100644 --- a/include/dm-demo.h +++ b/include/dm-demo.h @@ -6,8 +6,6 @@ #ifndef __DM_DEMO_H #define __DM_DEMO_H -#include - /** * struct dm_demo_pdata - configuration data for demo instance * -- cgit v1.3.1 From 0e1fad4382fbceb630d09e7009afe1b1b31a64d6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:37 -0600 Subject: dm: core: Drop header files from dm/test.h These header file should not be included in other header files. Remove them and add to each individual file. Add test/test.h to test/ui.h since that is a reasonable place. Signed-off-by: Simon Glass --- include/dm/test.h | 3 --- include/test/ut.h | 1 + test/dm/adc.c | 1 + test/dm/audio.c | 1 + test/dm/axi.c | 3 ++- test/dm/blk.c | 1 + test/dm/board.c | 1 + test/dm/bootcount.c | 1 + test/dm/bus.c | 1 + test/dm/clk.c | 1 + test/dm/clk_ccf.c | 1 + test/dm/core.c | 1 + test/dm/cpu.c | 1 + test/dm/dma.c | 1 + test/dm/dsi_host.c | 1 + test/dm/eth.c | 3 ++- test/dm/firmware.c | 1 + test/dm/gpio.c | 3 ++- test/dm/hwspinlock.c | 1 + test/dm/i2c.c | 1 + test/dm/i2s.c | 3 ++- test/dm/led.c | 1 + test/dm/mailbox.c | 1 + test/dm/mdio.c | 5 +++-- test/dm/mdio_mux.c | 5 +++-- test/dm/misc.c | 1 + test/dm/mmc.c | 1 + test/dm/nop.c | 1 + test/dm/ofnode.c | 1 + test/dm/osd.c | 5 +++-- test/dm/panel.c | 3 ++- test/dm/pch.c | 1 + test/dm/pci.c | 1 + test/dm/pci_ep.c | 5 +++-- test/dm/phy.c | 1 + test/dm/pmic.c | 5 +++-- test/dm/power-domain.c | 1 + test/dm/pwm.c | 1 + test/dm/ram.c | 1 + test/dm/regmap.c | 1 + test/dm/regulator.c | 1 + test/dm/remoteproc.c | 2 ++ test/dm/reset.c | 1 + test/dm/rtc.c | 1 + test/dm/serial.c | 1 + test/dm/sf.c | 1 + test/dm/smem.c | 1 + test/dm/sound.c | 1 + test/dm/spi.c | 1 + test/dm/spmi.c | 1 + test/dm/syscon.c | 1 + test/dm/sysreset.c | 1 + test/dm/tee.c | 1 + test/dm/test-driver.c | 3 ++- test/dm/test-fdt.c | 1 + test/dm/test-main.c | 2 ++ test/dm/test-uclass.c | 1 + test/dm/timer.c | 1 + test/dm/usb.c | 1 + test/dm/video.c | 1 + test/dm/virtio.c | 3 ++- test/dm/wdt.c | 1 + test/lib/lmb.c | 2 ++ 63 files changed, 82 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/dm/test.h b/include/dm/test.h index d39686cde28..2c92d412781 100644 --- a/include/dm/test.h +++ b/include/dm/test.h @@ -6,9 +6,6 @@ #ifndef __DM_TEST_H #define __DM_TEST_H -#include -#include - /** * struct dm_test_cdata - configuration data for test instance * diff --git a/include/test/ut.h b/include/test/ut.h index 99bbb1230c7..6ab2f8830df 100644 --- a/include/test/ut.h +++ b/include/test/ut.h @@ -11,6 +11,7 @@ #include #include #include +#include struct unit_test_state; diff --git a/test/dm/adc.c b/test/dm/adc.c index da7bd4bf1f9..7fa1d48dd9a 100644 --- a/test/dm/adc.c +++ b/test/dm/adc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include static int dm_test_adc_bind(struct unit_test_state *uts) diff --git a/test/dm/audio.c b/test/dm/audio.c index 77c3a3625bd..4bb86e3214c 100644 --- a/test/dm/audio.c +++ b/test/dm/audio.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/test/dm/axi.c b/test/dm/axi.c index e1155a51dd7..5b1bbab0b81 100644 --- a/test/dm/axi.c +++ b/test/dm/axi.c @@ -8,9 +8,10 @@ #include #include #include +#include #include +#include #include -#include /* Test that sandbox AXI works correctly */ static int dm_test_axi_base(struct unit_test_state *uts) diff --git a/test/dm/blk.c b/test/dm/blk.c index 94b2855b8e9..80d671e5616 100644 --- a/test/dm/blk.c +++ b/test/dm/blk.c @@ -9,6 +9,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/test/dm/board.c b/test/dm/board.c index 5472c65fad6..ff50d6c38bc 100644 --- a/test/dm/board.c +++ b/test/dm/board.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "../../drivers/board/sandbox.h" diff --git a/test/dm/bootcount.c b/test/dm/bootcount.c index be0c2789070..9fd3751ef7e 100644 --- a/test/dm/bootcount.c +++ b/test/dm/bootcount.c @@ -9,6 +9,7 @@ #include #include #include +#include #include static int dm_test_bootcount(struct unit_test_state *uts) diff --git a/test/dm/bus.c b/test/dm/bus.c index 73eb3aede3d..07072673613 100644 --- a/test/dm/bus.c +++ b/test/dm/bus.c @@ -14,6 +14,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/test/dm/clk.c b/test/dm/clk.c index 48fc3dd714c..7a39760f258 100644 --- a/test/dm/clk.c +++ b/test/dm/clk.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* Base test of the clk uclass */ diff --git a/test/dm/clk_ccf.c b/test/dm/clk_ccf.c index ae3a4d8a76a..da2292a51a9 100644 --- a/test/dm/clk_ccf.c +++ b/test/dm/clk_ccf.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/test/dm/core.c b/test/dm/core.c index d20c48443f6..9b73ec3aa64 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -16,6 +16,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/test/dm/cpu.c b/test/dm/cpu.c index 46683d884a4..0a75c910872 100644 --- a/test/dm/cpu.c +++ b/test/dm/cpu.c @@ -10,6 +10,7 @@ #include #include #include +#include #include static int dm_test_cpu(struct unit_test_state *uts) diff --git a/test/dm/dma.c b/test/dm/dma.c index 317ed4fe8c6..1cdc813619f 100644 --- a/test/dm/dma.c +++ b/test/dm/dma.c @@ -11,6 +11,7 @@ #include #include #include +#include #include static int dm_test_dma_m2m(struct unit_test_state *uts) diff --git a/test/dm/dsi_host.c b/test/dm/dsi_host.c index 59fcd5558f0..97917a17c1e 100644 --- a/test/dm/dsi_host.c +++ b/test/dm/dsi_host.c @@ -10,6 +10,7 @@ #include #include #include +#include #include static int dm_test_dsi_host_phy_init(void *priv_data) diff --git a/test/dm/eth.c b/test/dm/eth.c index b58c9640a27..1a3eb1839ce 100644 --- a/test/dm/eth.c +++ b/test/dm/eth.c @@ -13,10 +13,11 @@ #include #include #include +#include #include #include #include -#include +#include #include #define DM_TEST_ETH_NUM 4 diff --git a/test/dm/firmware.c b/test/dm/firmware.c index 60fdcbb33f4..2b4f49af80b 100644 --- a/test/dm/firmware.c +++ b/test/dm/firmware.c @@ -8,6 +8,7 @@ #include #include #include +#include #include /* Base test of firmware probe */ diff --git a/test/dm/gpio.c b/test/dm/gpio.c index b7ee8fc3cae..f3c467e9ac7 100644 --- a/test/dm/gpio.c +++ b/test/dm/gpio.c @@ -9,10 +9,11 @@ #include #include #include +#include #include #include #include -#include +#include #include /* Test that sandbox GPIOs work correctly */ diff --git a/test/dm/hwspinlock.c b/test/dm/hwspinlock.c index 09ec38b4f37..49c52bcd630 100644 --- a/test/dm/hwspinlock.c +++ b/test/dm/hwspinlock.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* Test that hwspinlock driver functions are called */ diff --git a/test/dm/i2c.c b/test/dm/i2c.c index 2025c4216d0..25b2c7c6176 100644 --- a/test/dm/i2c.c +++ b/test/dm/i2c.c @@ -16,6 +16,7 @@ #include #include #include +#include #include static const int busnum; diff --git a/test/dm/i2s.c b/test/dm/i2s.c index 49ebc3523c0..7a017be0649 100644 --- a/test/dm/i2s.c +++ b/test/dm/i2s.c @@ -7,9 +7,10 @@ #include #include #include +#include #include +#include #include -#include /* Basic test of the i2s codec uclass */ static int dm_test_i2s(struct unit_test_state *uts) diff --git a/test/dm/led.c b/test/dm/led.c index 00de7b3997c..3d5ad9363b4 100644 --- a/test/dm/led.c +++ b/test/dm/led.c @@ -8,6 +8,7 @@ #include #include #include +#include #include /* Base test of the led uclass */ diff --git a/test/dm/mailbox.c b/test/dm/mailbox.c index e6c521b8b54..e9c8ab1a95b 100644 --- a/test/dm/mailbox.c +++ b/test/dm/mailbox.c @@ -8,6 +8,7 @@ #include #include #include +#include #include static int dm_test_mailbox(struct unit_test_state *uts) diff --git a/test/dm/mdio.c b/test/dm/mdio.c index ba1b54f27e2..758bbb2cc51 100644 --- a/test/dm/mdio.c +++ b/test/dm/mdio.c @@ -7,10 +7,11 @@ #include #include #include -#include +#include #include +#include +#include #include -#include /* macros copied over from mdio_sandbox.c */ #define SANDBOX_PHY_ADDR 5 diff --git a/test/dm/mdio_mux.c b/test/dm/mdio_mux.c index f962e09dbc2..0b3f85a53be 100644 --- a/test/dm/mdio_mux.c +++ b/test/dm/mdio_mux.c @@ -6,10 +6,11 @@ #include #include -#include +#include #include +#include +#include #include -#include /* macros copied over from mdio_sandbox.c */ #define SANDBOX_PHY_ADDR 5 diff --git a/test/dm/misc.c b/test/dm/misc.c index 26fd6acecb9..641070972d8 100644 --- a/test/dm/misc.c +++ b/test/dm/misc.c @@ -8,6 +8,7 @@ #include #include #include +#include #include static int dm_test_misc(struct unit_test_state *uts) diff --git a/test/dm/mmc.c b/test/dm/mmc.c index 49402b9c902..8e1fd3fe51a 100644 --- a/test/dm/mmc.c +++ b/test/dm/mmc.c @@ -8,6 +8,7 @@ #include #include #include +#include #include /* diff --git a/test/dm/nop.c b/test/dm/nop.c index 2df29f3d15b..8b3b6468927 100644 --- a/test/dm/nop.c +++ b/test/dm/nop.c @@ -13,6 +13,7 @@ #include #include #include +#include #include static int noptest_bind(struct udevice *parent) diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c index 1114f34cbf8..e01acc4fe92 100644 --- a/test/dm/ofnode.c +++ b/test/dm/ofnode.c @@ -5,6 +5,7 @@ #include #include #include +#include #include static int dm_test_ofnode_compatible(struct unit_test_state *uts) diff --git a/test/dm/osd.c b/test/dm/osd.c index 5739dfa0b8f..8784867ecbc 100644 --- a/test/dm/osd.c +++ b/test/dm/osd.c @@ -7,10 +7,11 @@ #include #include #include -#include -#include #include #include +#include +#include +#include #include "../../drivers/video/sandbox_osd.h" diff --git a/test/dm/panel.c b/test/dm/panel.c index 7e4ebd6d81e..410e8f3907f 100644 --- a/test/dm/panel.c +++ b/test/dm/panel.c @@ -14,8 +14,9 @@ #include #include #include -#include #include +#include +#include /* Basic test of the panel uclass */ static int dm_test_panel(struct unit_test_state *uts) diff --git a/test/dm/pch.c b/test/dm/pch.c index 54e33d187b6..bf17a31ccf9 100644 --- a/test/dm/pch.c +++ b/test/dm/pch.c @@ -8,6 +8,7 @@ #include #include #include +#include #include /* Test that sandbox PCH works correctly */ diff --git a/test/dm/pci.c b/test/dm/pci.c index 39e82b3699f..a492fc03553 100644 --- a/test/dm/pci.c +++ b/test/dm/pci.c @@ -8,6 +8,7 @@ #include #include #include +#include #include /* Test that sandbox PCI works correctly */ diff --git a/test/dm/pci_ep.c b/test/dm/pci_ep.c index 101f8617513..a29d00eebea 100644 --- a/test/dm/pci_ep.c +++ b/test/dm/pci_ep.c @@ -5,12 +5,13 @@ #include #include +#include +#include #include #include #include +#include #include -#include -#include /* Test that sandbox PCI EP works correctly */ static int dm_test_pci_ep_base(struct unit_test_state *uts) diff --git a/test/dm/phy.c b/test/dm/phy.c index 99f01195578..1a59899327a 100644 --- a/test/dm/phy.c +++ b/test/dm/phy.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* Base test of the phy uclass */ diff --git a/test/dm/pmic.c b/test/dm/pmic.c index b582329a9c5..8c2766aeac6 100644 --- a/test/dm/pmic.c +++ b/test/dm/pmic.c @@ -10,16 +10,17 @@ #include #include #include +#include #include #include #include -#include #include #include +#include #include #include +#include #include -#include /* Test PMIC get method */ diff --git a/test/dm/power-domain.c b/test/dm/power-domain.c index 8baf5d09d1d..52f88c5a360 100644 --- a/test/dm/power-domain.c +++ b/test/dm/power-domain.c @@ -8,6 +8,7 @@ #include #include #include +#include #include /* This must match the specifier for power-domains in the DT node */ diff --git a/test/dm/pwm.c b/test/dm/pwm.c index b52ee21a69e..8cc911e1add 100644 --- a/test/dm/pwm.c +++ b/test/dm/pwm.c @@ -7,6 +7,7 @@ #include #include #include +#include #include /* Basic test of the pwm uclass */ diff --git a/test/dm/ram.c b/test/dm/ram.c index 3efdb6b80b2..2456466b561 100644 --- a/test/dm/ram.c +++ b/test/dm/ram.c @@ -7,6 +7,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/test/dm/regmap.c b/test/dm/regmap.c index 809494d585e..42cc4cb0c06 100644 --- a/test/dm/regmap.c +++ b/test/dm/regmap.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* Base test of register maps */ diff --git a/test/dm/regulator.c b/test/dm/regulator.c index ca916eeebb6..f412ec20c53 100644 --- a/test/dm/regulator.c +++ b/test/dm/regulator.c @@ -20,6 +20,7 @@ #include #include #include +#include #include enum { diff --git a/test/dm/remoteproc.c b/test/dm/remoteproc.c index 9511c7dd6f5..c6bf2c4c465 100644 --- a/test/dm/remoteproc.c +++ b/test/dm/remoteproc.c @@ -10,7 +10,9 @@ #include #include #include +#include #include + /** * dm_test_remoteproc_base() - test the operations after initializations * @uts: unit test state diff --git a/test/dm/reset.c b/test/dm/reset.c index 871d6400a07..82328072644 100644 --- a/test/dm/reset.c +++ b/test/dm/reset.c @@ -10,6 +10,7 @@ #include #include #include +#include #include /* This must match the specifier for mbox-names="test" in the DT node */ diff --git a/test/dm/rtc.c b/test/dm/rtc.c index dd037a6e17a..42a9195b731 100644 --- a/test/dm/rtc.c +++ b/test/dm/rtc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* Simple RTC sanity check */ diff --git a/test/dm/serial.c b/test/dm/serial.c index 6237693cb80..a1b122ec1dc 100644 --- a/test/dm/serial.c +++ b/test/dm/serial.c @@ -8,6 +8,7 @@ #include #include #include +#include #include static int dm_test_serial(struct unit_test_state *uts) diff --git a/test/dm/sf.c b/test/dm/sf.c index 9e7dead684d..0f2808fca48 100644 --- a/test/dm/sf.c +++ b/test/dm/sf.c @@ -15,6 +15,7 @@ #include #include #include +#include #include /* Simple test of sandbox SPI flash */ diff --git a/test/dm/smem.c b/test/dm/smem.c index 4099a5f66c4..21dd96e4092 100644 --- a/test/dm/smem.c +++ b/test/dm/smem.c @@ -7,6 +7,7 @@ #include #include #include +#include #include /* Basic test of the smem uclass */ diff --git a/test/dm/sound.c b/test/dm/sound.c index aa5368f05b9..9cb9961058b 100644 --- a/test/dm/sound.c +++ b/test/dm/sound.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* Basic test of the sound codec uclass */ diff --git a/test/dm/spi.c b/test/dm/spi.c index ff2cddd2459..10b89e7acfe 100644 --- a/test/dm/spi.c +++ b/test/dm/spi.c @@ -13,6 +13,7 @@ #include #include #include +#include #include /* Test that we can find buses and chip-selects */ diff --git a/test/dm/spmi.c b/test/dm/spmi.c index 668b7e133ff..4aae1f166d2 100644 --- a/test/dm/spmi.c +++ b/test/dm/spmi.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* Test if bus childs got probed propperly*/ diff --git a/test/dm/syscon.c b/test/dm/syscon.c index 06a1c69ac5c..b2d0ade95ee 100644 --- a/test/dm/syscon.c +++ b/test/dm/syscon.c @@ -11,6 +11,7 @@ #include #include #include +#include #include /* Base test of system controllers */ diff --git a/test/dm/sysreset.c b/test/dm/sysreset.c index 5b2358ef674..e5cd18cd82e 100644 --- a/test/dm/sysreset.c +++ b/test/dm/sysreset.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* Test that we can use particular sysreset devices */ diff --git a/test/dm/tee.c b/test/dm/tee.c index 632e9960b0b..fec9551fb27 100644 --- a/test/dm/tee.c +++ b/test/dm/tee.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/test/dm/test-driver.c b/test/dm/test-driver.c index ba85fa313e8..08bdf011946 100644 --- a/test/dm/test-driver.c +++ b/test/dm/test-driver.c @@ -11,9 +11,10 @@ #include #include #include +#include #include +#include #include -#include int dm_testdrv_op_count[DM_TEST_OP_COUNT]; static struct unit_test_state *uts = &global_dm_test_state; diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c index 8ef7c7a88e8..c64ac405ede 100644 --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@ -18,6 +18,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/test/dm/test-main.c b/test/dm/test-main.c index 53e5ca321fe..6d197d0d610 100644 --- a/test/dm/test-main.c +++ b/test/dm/test-main.c @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/test/dm/test-uclass.c b/test/dm/test-uclass.c index b6d629a285c..760731b0667 100644 --- a/test/dm/test-uclass.c +++ b/test/dm/test-uclass.c @@ -14,6 +14,7 @@ #include #include #include +#include #include static struct unit_test_state *uts = &global_dm_test_state; diff --git a/test/dm/timer.c b/test/dm/timer.c index 9367dab5d5e..4aa5eeac75b 100644 --- a/test/dm/timer.c +++ b/test/dm/timer.c @@ -7,6 +7,7 @@ #include #include #include +#include #include /* diff --git a/test/dm/usb.c b/test/dm/usb.c index b273a515efd..6cbb66c82b7 100644 --- a/test/dm/usb.c +++ b/test/dm/usb.c @@ -14,6 +14,7 @@ #include #include #include +#include #include struct keyboard_test_data { diff --git a/test/dm/video.c b/test/dm/video.c index 19f78b62390..9523a0173dc 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -15,6 +15,7 @@ #include #include #include +#include #include /* diff --git a/test/dm/virtio.c b/test/dm/virtio.c index 4a0c0b23b88..6361cd53339 100644 --- a/test/dm/virtio.c +++ b/test/dm/virtio.c @@ -9,9 +9,10 @@ #include #include #include -#include #include #include +#include +#include #include /* Basic test of the virtio uclass */ diff --git a/test/dm/wdt.c b/test/dm/wdt.c index 1d31ec55c64..c704098b24c 100644 --- a/test/dm/wdt.c +++ b/test/dm/wdt.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* Test that watchdog driver functions are called */ diff --git a/test/lib/lmb.c b/test/lib/lmb.c index a0fe0f6b339..a3449875096 100644 --- a/test/lib/lmb.c +++ b/test/lib/lmb.c @@ -4,10 +4,12 @@ */ #include +#include #include #include #include #include +#include #include static int check_lmb(struct unit_test_state *uts, struct lmb *lmb, -- cgit v1.3.1 From c2848cc2c35ccaedb10f23c3ee2a46ffdcc0de0c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:38 -0600 Subject: fs: fs-loader: 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 --- drivers/fpga/socfpga_arria10.c | 1 + include/fs_loader.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/drivers/fpga/socfpga_arria10.c b/drivers/fpga/socfpga_arria10.c index dfd3cbb4610..44e1ac54c3f 100644 --- a/drivers/fpga/socfpga_arria10.c +++ b/drivers/fpga/socfpga_arria10.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/include/fs_loader.h b/include/fs_loader.h index b728c06fcff..1b3c58086f5 100644 --- a/include/fs_loader.h +++ b/include/fs_loader.h @@ -6,7 +6,7 @@ #ifndef _FS_LOADER_H_ #define _FS_LOADER_H_ -#include +struct udevice; /** * struct phandle_part - A place for storing phandle of node and its partition -- cgit v1.3.1 From 2a64ada78cba32196a4f49bd000a501fa2c96647 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:39 -0600 Subject: net: Drop dm.h header file from phy.h 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 --- 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(-) (limited to 'include') diff --git a/cmd/mdio.c b/cmd/mdio.c index c48bb51237c..cfa45ad12a0 100644 --- a/cmd/mdio.c +++ b/cmd/mdio.c @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/cmd/mii.c b/cmd/mii.c index b52a55dc339..fe8602eb7c8 100644 --- a/cmd/mii.c +++ b/cmd/mii.c @@ -10,6 +10,7 @@ #include #include +#include #include typedef struct _MII_field_desc_t { diff --git a/include/dm/read.h b/include/dm/read.h index b1a61085440..487ec9e9c93 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -11,6 +11,7 @@ #include +#include #include #include #include diff --git a/include/phy.h b/include/phy.h index fedd1460919..1dbbf651113 100644 --- a/include/phy.h +++ b/include/phy.h @@ -9,14 +9,17 @@ #ifndef _PHY_H #define _PHY_H -#include +#include +#include +#include +#include #include #include #include #include #include -#include -#include + +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 882e4af8ffd..841ade311ef 100644 --- a/include/phy_interface.h +++ b/include/phy_interface.h @@ -10,6 +10,8 @@ #ifndef _PHY_INTERFACE_H #define _PHY_INTERFACE_H +#include + typedef enum { PHY_INTERFACE_MODE_MII, PHY_INTERFACE_MODE_GMII, diff --git a/net/eth_legacy.c b/net/eth_legacy.c index 340469ba3aa..992d1880bf3 100644 --- a/net/eth_legacy.c +++ b/net/eth_legacy.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include -- cgit v1.3.1 From a00867b47a4be848c400f74b97479193a41d327c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:40 -0600 Subject: sf: Drop dm.h header file from spi_flash.h This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- 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(-) (limited to 'include') diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c index 513be09c687..96be069ee80 100644 --- a/arch/arm/mach-k3/sysfw-loader.c +++ b/arch/arm/mach-k3/sysfw-loader.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c index 70940f01f32..8aad4be467e 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 #include +#include #include #include #include diff --git a/arch/x86/cpu/ivybridge/sdram.c b/arch/x86/cpu/ivybridge/sdram.c index 99bc48021e6..dd6b8753de6 100644 --- a/arch/x86/cpu/ivybridge/sdram.c +++ b/arch/x86/cpu/ivybridge/sdram.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c index 0cda9196f93..38eb0f27c90 100644 --- a/board/st/common/stm32mp_dfu.c +++ b/board/st/common/stm32mp_dfu.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/include/spi_flash.h b/include/spi_flash.h index b3366194876..85cae32cc73 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -9,10 +9,11 @@ #ifndef _SPI_FLASH_H_ #define _SPI_FLASH_H_ -#include /* Because we dereference struct udevice here */ #include #include +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 -- cgit v1.3.1 From 055efe5690eaab99301151878deab9a382c6e65e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:41 -0600 Subject: thermal: 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 --- arch/arm/mach-imx/cpu.c | 1 + include/thermal.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 694c26d35fe..fe8d5947cce 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/include/thermal.h b/include/thermal.h index 11d75256e08..52a3317fd54 100644 --- a/include/thermal.h +++ b/include/thermal.h @@ -7,7 +7,7 @@ #ifndef _THERMAL_H_ #define _THERMAL_H_ -#include +struct udevice; int thermal_get_temp(struct udevice *dev, int *temp); -- cgit v1.3.1 From 411e9eb88c0cf2b99f3dcaa9b300c0e52ee751f3 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:42 -0600 Subject: w1: 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 --- board/atmel/common/board.c | 1 + cmd/w1.c | 1 + include/w1.h | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/board/atmel/common/board.c b/board/atmel/common/board.c index c41706c4005..eee5c357bdc 100644 --- a/board/atmel/common/board.c +++ b/board/atmel/common/board.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include diff --git a/cmd/w1.c b/cmd/w1.c index 92be1f2531d..459094bf809 100644 --- a/cmd/w1.c +++ b/cmd/w1.c @@ -6,6 +6,7 @@ */ #include #include +#include #include #include #include diff --git a/include/w1.h b/include/w1.h index b958b1c92c2..77f439e587f 100644 --- a/include/w1.h +++ b/include/w1.h @@ -8,7 +8,7 @@ #ifndef __W1_H #define __W1_H -#include +struct udevice; #define W1_FAMILY_DS24B33 0x23 #define W1_FAMILY_DS2431 0x2d -- cgit v1.3.1 From e1e10f29f9b5739b39b08b0c0040ec0cb315f3d7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:43 -0600 Subject: efi: Tidy up header includes Two files relies on efi_driver.h to include common.h and dm.h which is incorrect. The former should always be included in a non-host C file and the latter should be included if driver model is used. Signed-off-by: Simon Glass --- include/efi_driver.h | 2 -- lib/efi_driver/efi_block_device.c | 1 + lib/efi_driver/efi_uclass.c | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/efi_driver.h b/include/efi_driver.h index 840483a416a..2b62219c5bf 100644 --- a/include/efi_driver.h +++ b/include/efi_driver.h @@ -8,8 +8,6 @@ #ifndef _EFI_DRIVER_H #define _EFI_DRIVER_H 1 -#include -#include #include /* diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index e7d8745ad85..0e72a68bced 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include diff --git a/lib/efi_driver/efi_uclass.c b/lib/efi_driver/efi_uclass.c index 04e4e457344..0cf74b0361d 100644 --- a/lib/efi_driver/efi_uclass.c +++ b/lib/efi_driver/efi_uclass.c @@ -17,6 +17,8 @@ * controllers. */ +#include +#include #include #include #include -- cgit v1.3.1 From fb989e0c6ce019466f24fbd529890d89a21c8472 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:56 -0600 Subject: clk: Drop dm.h header file in clk-provider.h This header file should not be included in other header files. Remove it and use a forward declaration and un-inlining of dev_get_clk_ptr() instead. Fix up the kendryte header files to avoid build errors. Signed-off-by: Simon Glass Reviewed-by: Sean Anderson --- drivers/clk/clk-uclass.c | 5 +++++ drivers/clk/kendryte/bypass.c | 7 +++++-- drivers/clk/kendryte/pll.c | 10 ++++++---- include/kendryte/bypass.h | 2 +- include/linux/clk-provider.h | 8 +++----- 5 files changed, 20 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 15656f5973d..934cd5787a5 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -25,6 +25,11 @@ static inline const struct clk_ops *clk_dev_ops(struct udevice *dev) return (const struct clk_ops *)dev->driver->ops; } +struct clk *dev_get_clk_ptr(struct udevice *dev) +{ + return (struct clk *)dev_get_uclass_priv(dev); +} + #if CONFIG_IS_ENABLED(OF_CONTROL) # if CONFIG_IS_ENABLED(OF_PLATDATA) int clk_get_by_driver_info(struct udevice *dev, struct phandle_1_arg *cells, diff --git a/drivers/clk/kendryte/bypass.c b/drivers/clk/kendryte/bypass.c index d1fd28175ba..5f1986f2cb8 100644 --- a/drivers/clk/kendryte/bypass.c +++ b/drivers/clk/kendryte/bypass.c @@ -4,12 +4,15 @@ */ #define LOG_CATEGORY UCLASS_CLK -#include +#include +#include #include +#include +#include +#include #include #include -#include #define CLK_K210_BYPASS "k210_clk_bypass" diff --git a/drivers/clk/kendryte/pll.c b/drivers/clk/kendryte/pll.c index 19e358856a8..ab6d75d585a 100644 --- a/drivers/clk/kendryte/pll.c +++ b/drivers/clk/kendryte/pll.c @@ -3,18 +3,20 @@ * Copyright (C) 2019-20 Sean Anderson */ #define LOG_CATEGORY UCLASS_CLK -#include -#include +#include +#include /* For DIV_ROUND_DOWN_ULL, defined in linux/kernel.h */ #include +#include +#include +#include #include +#include #include #include #include #include -#include -#include #define CLK_K210_PLL "k210_clk_pll" diff --git a/include/kendryte/bypass.h b/include/kendryte/bypass.h index a081cbd12ff..ab85bbcbfca 100644 --- a/include/kendryte/bypass.h +++ b/include/kendryte/bypass.h @@ -5,7 +5,7 @@ #ifndef K210_BYPASS_H #define K210_BYPASS_H -#include +struct clk; struct k210_bypass { struct clk clk; diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 8a20743ad84..79dce8f0ad6 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -9,12 +9,13 @@ #ifndef __LINUX_CLK_PROVIDER_H #define __LINUX_CLK_PROVIDER_H -#include #include #include #include #include +struct udevice; + static inline void clk_dm(ulong id, struct clk *clk) { if (!IS_ERR(clk)) @@ -188,8 +189,5 @@ struct clk *clk_register_mux(struct device *dev, const char *name, const char *clk_hw_get_name(const struct clk *hw); ulong clk_generic_get_rate(struct clk *clk); -static inline struct clk *dev_get_clk_ptr(struct udevice *dev) -{ - return (struct clk *)dev_get_uclass_priv(dev); -} +struct clk *dev_get_clk_ptr(struct udevice *dev); #endif /* __LINUX_CLK_PROVIDER_H */ -- cgit v1.3.1 From f125e3cc1217c630dab1673c2ca181cc754b434b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:57 -0600 Subject: net: Drop dm.h header file in eth_phy.h This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- include/eth_phy.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/eth_phy.h b/include/eth_phy.h index 19c496551b4..be6c8815270 100644 --- a/include/eth_phy.h +++ b/include/eth_phy.h @@ -6,9 +6,10 @@ #ifndef _eth_phy_h_ #define _eth_phy_h_ -#include #include +struct udevice; + int eth_phy_binds_nodes(struct udevice *eth_dev); int eth_phy_set_mdio_bus(struct udevice *eth_dev, struct mii_dev *mdio_bus); struct mii_dev *eth_phy_get_mdio_bus(struct udevice *eth_dev); -- cgit v1.3.1 From a0558aca55c16a7f561656cb11bf172ef414bcec Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:15:59 -0600 Subject: dm: core: Guard against including dm.h in header files Header files generally should not include header files just for a struct, since forward declarations work just as well and reduce overhead. Add a warning for dm.h being included, since this has crept into U-Boot. Signed-off-by: Simon Glass --- include/dm.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/dm.h b/include/dm.h index 2e1afda4402..a1b84169e64 100644 --- a/include/dm.h +++ b/include/dm.h @@ -3,6 +3,10 @@ * Copyright (c) 2013 Google, Inc */ +#ifdef _DM_H_ +#warning "Suspect dm.h is included from a header file - please fix" +#endif + #ifndef _DM_H_ #define _DM_H_ -- cgit v1.3.1