dm: Avoid including dm.h in header files
Subsystems (21)
cover dm: Avoid including dm.h in header files
At present a small number of header files include the dm.h header file. The intent with driver model is for C files that use it to define dm.h themselves. This helps indicate that driver model is supported and also reduces the amount of code pointlessly included and relying on header guards. Ultimately (combined with the reduction in size of common.h) this should speed up U-Boot compilation.
This series removes all uses of dm.h in header files and adds a warning to avert more such activity.
Simon Glass (31):
spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL
mtd: spi-nor: Tidy up error handling / debug code
wdt: Drop dm.h header file
mtd: spi-mem: Drop dm.h header file
mtd: spi: Drop SPI_XFER_MMAP*
dm: core: Drop dm.h header file from dm-demo.h
dm: core: Drop header files from dm/test.h
fs: fs-loader: Drop dm.h header file
net: Drop dm.h header file from phy.h
sf: Drop dm.h header file from spi_flash.h
thermal: Drop dm.h header file
w1: Drop dm.h header file
efi: Tidy up header includes
power: Tidy up inclusion of regulator_common.h
mmc: Drop duplicate dm.h inclusion
spi: Drop duplicate dm.h inclusion
ti: am654: Drop duplicate dm.h inclusion
liebherr: Drop duplicate dm.h inclusion
pci: Drop dm.h inclusion from header file
mediatek: Drop dm.h header file
mscc: Drop dm.h header file
adc: Drop dm.h header file
nand: Drop dm.h header file
ufs: Drop dm.h header file
usb: Drop dm.h header file
clk: Drop dm.h header file in clk-provider.h
net: Drop dm.h header file in eth_phy.h
net: Drop duplicate include of dm.h in pcnet.c
dm: core: Guard against including dm.h in header files
patman: Fix up the test comments
checkpatch: Don't allow common.h and dm.h in headers
arch/arm/include/asm/arch-mediatek/reset.h | 2 +- arch/arm/mach-imx/cpu.c | 1 + arch/arm/mach-k3/sysfw-loader.c | 1 + .../cmd_stm32prog/stm32prog_serial.c | 1 + arch/mips/mach-mscc/include/mach/jr2/jr2.h | 3 -- .../mips/mach-mscc/include/mach/luton/luton.h | 3 -- .../mach-mscc/include/mach/ocelot/ocelot.h | 3 -- .../mach-mscc/include/mach/serval/serval.h | 3 -- .../mach-mscc/include/mach/servalt/servalt.h | 3 -- arch/x86/cpu/ivybridge/sdram.c | 1 + board/atmel/common/board.c | 1 + board/liebherr/display5/display5.c | 1 - board/mscc/servalt/servalt.c | 2 + board/st/common/stm32mp_dfu.c | 1 + cmd/demo.c | 1 + cmd/mdio.c | 1 + cmd/mii.c | 1 + cmd/w1.c | 1 + common/spl/Kconfig | 10 +++++ drivers/adc/stm32-adc-core.c | 1 + drivers/adc/stm32-adc-core.h | 4 +- drivers/adc/stm32-adc.c | 1 + drivers/clk/clk-uclass.c | 5 +++ drivers/clk/kendryte/bypass.c | 7 ++- drivers/clk/kendryte/pll.c | 10 +++-- drivers/fpga/socfpga_arria10.c | 1 + drivers/mmc/sdhci.c | 1 - .../mtd/nand/raw/brcmnand/brcmnand_compat.c | 1 + .../mtd/nand/raw/brcmnand/brcmnand_compat.h | 4 +- drivers/mtd/spi/Makefile | 2 +- drivers/mtd/spi/sf_probe.c | 2 +- drivers/mtd/spi/spi-nor-core.c | 2 +- drivers/mtd/spi/spi-nor-tiny.c | 4 +- drivers/net/pcnet.c | 1 - drivers/pci/pcie_layerscape.h | 1 - drivers/pci/pcie_layerscape_fixup.c | 1 + drivers/pci/pcie_layerscape_gen4.h | 1 - drivers/pci/pcie_layerscape_gen4_fixup.c | 1 + drivers/power/regulator/fixed.c | 3 +- drivers/power/regulator/gpio-regulator.c | 3 +- drivers/power/regulator/regulator_common.c | 4 +- drivers/power/regulator/regulator_common.h | 2 - drivers/ram/k3-am654-ddrss.c | 1 - drivers/spi/mscc_bb_spi.c | 1 - drivers/spi/spi-mem.c | 7 ++- drivers/spi/spi-sifive.c | 1 + drivers/spi/stm32_qspi.c | 2 + drivers/ufs/cdns-platform.c | 1 + drivers/ufs/ufs.c | 3 +- drivers/ufs/ufs.h | 5 +-- drivers/usb/musb-new/musb_uboot.c | 37 +++++++++++++++ drivers/usb/musb-new/pic32.c | 1 + drivers/usb/musb-new/usb-compat.h | 45 ++++--------------- include/dm-demo.h | 2 - include/dm.h | 4 ++ include/dm/read.h | 1 + include/dm/test.h | 3 -- include/efi_driver.h | 2 - include/eth_phy.h | 3 +- include/fs_loader.h | 2 +- include/kendryte/bypass.h | 2 +- include/linux/clk-provider.h | 8 ++-- include/phy.h | 9 ++-- include/phy_interface.h | 2 + include/spi-mem.h | 5 +-- include/spi.h | 2 - include/spi_flash.h | 3 +- include/test/ut.h | 1 + include/thermal.h | 2 +- include/w1.h | 2 +- include/wdt.h | 4 +- lib/efi_driver/efi_block_device.c | 1 + lib/efi_driver/efi_uclass.c | 2 + net/eth_legacy.c | 1 + scripts/checkpatch.pl | 10 ++++- 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 + tools/patman/test_checkpatch.py | 17 ++++--- 137 files changed, 254 insertions(+), 138 deletions(-)
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 1/31 spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL
In some cases SPL needs to be able to erase but TPL just needs to read. Allow these to have separate settings for SPI_FLASH_TINY.
---
common/spl/Kconfig | 10 ++++++++++ drivers/mtd/spi/Makefile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
common/spl/Kconfig +10 -0
@@ -1496,6 +1496,16 @@ config TPL_SPI_FLASH_SUPPORT Enable support for using SPI flash in TPL. See SPL_SPI_FLASH_SUPPORT for details. +config TPL_SPI_FLASH_TINY + bool "Enable low footprint TPL SPI Flash support" + depends on TPL_SPI_FLASH_SUPPORT && !SPI_FLASH_BAR + default y if SPI_FLASH + help + Enable lightweight TPL SPI Flash support that supports just reading + data/images from flash. No support to write/erase flash. Enable + this if you have TPL size limitations and don't need full-fledged + SPI flash support. + config TPL_SPI_LOAD bool "Support loading from SPI flash" depends on TPL_SPI_FLASH_SUPPORT
drivers/mtd/spi/Makefile +1 -1
@@ -8,7 +8,7 @@ spi-nor-y := sf_probe.o spi-nor-ids.o ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_SPI_BOOT) += fsl_espi_spl.o -ifeq ($(CONFIG_SPL_SPI_FLASH_TINY),y) +ifeq ($(CONFIG_$(SPL_TPL_)SPI_FLASH_TINY),y) spi-nor-y += spi-nor-tiny.o else spi-nor-y += spi-nor-core.o
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 1/31 spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL
Quoted 4 lines · Simon Glass
In some cases SPL needs to be able to erase but TPL just needs to read. Allow these to have separate settings for
SPI_FLASH_TINY.Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/e61e3d00/attachment.sig>
PATCH 2/31 mtd: spi-nor: Tidy up error handling / debug code
In reply to Simon GlassThe -ENODEV error value in spi_nor_read_id() is incorrect since there clearly is a device - it just cannot be supported. Use -ENOMEDIUM instead which has the virtue of being less common.
Fix the return value in spi_nor_scan().
Also there are a few printf() statements which should be debug() since they bloat the code with unused strings at present. Fix those while here.
---
drivers/mtd/spi/sf_probe.c | 2 +- drivers/mtd/spi/spi-nor-core.c | 2 +- drivers/mtd/spi/spi-nor-tiny.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/spi/sf_probe.c +1 -1
@@ -119,7 +119,7 @@ static int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len)struct erase_info instr;if (offset % mtd->erasesize || len % mtd->erasesize) { -printf ("SF: Erase offset/length not multiple of erase size\n" ); +debug ("SF: Erase offset/length not multiple of erase size\n" );return -EINVAL ; }
drivers/mtd/spi/spi-nor-core.c +1 -1
@@ -2470,7 +2470,7 @@ static int spi_nor_init(struct spi_nor *nor)* designer) that this is bad. */ if (nor->flags &SNOR_F_BROKEN_RESET ) -printf ("enabling reset hack; may not recover from unexpected reboots\n" ); +debug ("enabling reset hack; may not recover from unexpected reboots\n" );set_4byte (nor, nor->info,1 ); }
drivers/mtd/spi/spi-nor-tiny.c +2 -2
@@ -377,7 +377,7 @@ static const struct flash_info *spi_nor_read_id(struct spi_nor *nor) }dev_dbg (nor->dev,"unrecognized JEDEC id bytes: %02x, %02x, %02x\n" , id[0 ], id[1 ], id[2 ]); -return ERR_PTR (-ENODEV ); +return ERR_PTR (-EMEDIUMTYPE ); } static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len,
@@ -733,7 +733,7 @@ int spi_nor_scan(struct spi_nor *nor) info =spi_nor_read_id (nor);if (IS_ERR_OR_NULL (info)) -return -ENOENT ; +return PTR_ERR (info);/* Parse the Serial Flash Discoverable Parameters table. */ ret =spi_nor_init_params (nor, info, ¶ms);if (ret)
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
Vignesh Raghavendra
maintainerPATCH 2/31 mtd: spi-nor: Tidy up error handling / debug code
Hi Simon,
Quoted 2 lines · Simon Glass
The
-ENODEVerror value inspi_nor_read_id()is incorrect since there clearly is a device - it just cannot be supported.
Description 's not entirely accurate... If there is no flash on the SPI bus, then read ID would return all 0s or 0xFFs depending on the pullups on the board which would fail to match any flash in the spi-nor-ids table.
So its not just the case of device IDs not recognized or supported by U-Boot, it maybe that flash is absent altogether.
Regards
Vignesh
Quoted 65 lines
Use
-ENOMEDIUMinstead
which has the virtue of being less common.Fix the return value in
spi_nor_scan().Also there are a few
printf()statements which should bedebug()since they bloat the code with unused strings at present. Fix those while here.Signed-off-by Simon Glass <[email protected]>---
drivers/mtd/spi/sf_probe.c | 2 +- drivers/mtd/spi/spi-nor-core.c | 2 +- drivers/mtd/spi/spi-nor-tiny.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)drivers/mtd/spi/sf_probe.c +1
-1@@ -119,7 +119,7 @@ static int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len)struct erase_info instr;if (offset % mtd->erasesize || len % mtd->erasesize) { -printf ("SF: Erase offset/length not multiple of erase size\n" ); +debug ("SF: Erase offset/length not multiple of erase size\n" );return -EINVAL ; }drivers/mtd/spi/spi-nor-core.c +1
-1@@ -2470,7 +2470,7 @@ static int spi_nor_init(struct spi_nor *nor)* designer) that this is bad. */ if (nor->flags &SNOR_F_BROKEN_RESET ) -printf ("enabling reset hack; may not recover from unexpected reboots\n" ); +debug ("enabling reset hack; may not recover from unexpected reboots\n" );set_4byte (nor, nor->info,1 ); }drivers/mtd/spi/spi-nor-tiny.c +2
-2@@ -377,7 +377,7 @@ static const struct flash_info *spi_nor_read_id(struct spi_nor *nor) }dev_dbg (nor->dev,"unrecognized JEDEC id bytes: %02x, %02x, %02x\n" , id[0 ], id[1 ], id[2 ]); -return ERR_PTR (-ENODEV ); +return ERR_PTR (-EMEDIUMTYPE ); } static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len,@@ -733,7 +733,7 @@ int spi_nor_scan(struct spi_nor *nor) info =spi_nor_read_id (nor);if (IS_ERR_OR_NULL (info)) -return -ENOENT ; +return PTR_ERR (info);/* Parse the Serial Flash Discoverable Parameters table. */ ret =spi_nor_init_params (nor, info, ¶ms);if (ret)
PATCH 2/31 mtd: spi-nor: Tidy up error handling / debug code
Hi Vignesh,
Quoted 7 lines · Vignesh Raghavendra
Hi Simon,
Quoted 2 lines · Simon Glass
The
-ENODEVerror value inspi_nor_read_id()is incorrect since there clearly is a device - it just cannot be supported.
Quoted 6 lines
Description 's not entirely accurate... If there is no flash on the SPI bus, then read ID would return all 0s or 0xFFs depending on the pullups on the board which would fail to match any flash in the spi-nor-ids table.
So its not just the case of device IDs not recognized or supported by U-Boot, it maybe that flash is absent altogether.
But struct udevice * exists, so there is a device. Whether it is connected to something is a separate issue.
The problem is that -ENODEV means that the device should not be created or should not exist.
What happens if an invalid ID is returned? Does it unbind the device?
Regards,
Simon
Quoted 69 lines
Regards
VigneshQuoted 65 lines
Use
-ENOMEDIUMinstead
which has the virtue of being less common.Fix the return value in
spi_nor_scan().Also there are a few
printf()statements which should bedebug()since they bloat the code with unused strings at present. Fix those while here.Signed-off-by Simon Glass <[email protected]>---
drivers/mtd/spi/sf_probe.c | 2 +- drivers/mtd/spi/spi-nor-core.c | 2 +- drivers/mtd/spi/spi-nor-tiny.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)drivers/mtd/spi/sf_probe.c +1
-1@@ -119,7 +119,7 @@ static int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len)struct erase_info instr;if (offset % mtd->erasesize || len % mtd->erasesize) { -printf ("SF: Erase offset/length not multiple of erase size\n" ); +debug ("SF: Erase offset/length not multiple of erase size\n" );return -EINVAL ; }drivers/mtd/spi/spi-nor-core.c +1
-1@@ -2470,7 +2470,7 @@ static int spi_nor_init(struct spi_nor *nor)* designer) that this is bad. */ if (nor->flags &SNOR_F_BROKEN_RESET ) -printf ("enabling reset hack; may not recover from unexpected reboots\n" ); +debug ("enabling reset hack; may not recover from unexpected reboots\n" );set_4byte (nor, nor->info,1 ); }drivers/mtd/spi/spi-nor-tiny.c +2
-2@@ -377,7 +377,7 @@ static const struct flash_info *spi_nor_read_id(struct spi_nor *nor) }dev_dbg (nor->dev,"unrecognized JEDEC id bytes: %02x, %02x, %02x\n" , id[0 ], id[1 ], id[2 ]); -return ERR_PTR (-ENODEV ); +return ERR_PTR (-EMEDIUMTYPE ); } static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len,@@ -733,7 +733,7 @@ int spi_nor_scan(struct spi_nor *nor) info =spi_nor_read_id (nor);if (IS_ERR_OR_NULL (info)) -return -ENOENT ; +return PTR_ERR (info);/* Parse the Serial Flash Discoverable Parameters table. */ ret =spi_nor_init_params (nor, info, ¶ms);if (ret)
Vignesh Raghavendra
maintainerPATCH 2/31 mtd: spi-nor: Tidy up error handling / debug code
Hi,
Quoted 17 lines · Simon Glass
Hi Vignesh,
Quoted 7 lines · Vignesh Raghavendra
Hi Simon,
Quoted 2 lines · Simon Glass
The
-ENODEVerror value inspi_nor_read_id()is incorrect since there clearly is a device - it just cannot be supported.Quoted 6 lines
Description 's not entirely accurate... If there is no flash on the SPI bus, then read ID would return all 0s or 0xFFs depending on the pullups on the board which would fail to match any flash in the spi-nor-ids table.
So its not just the case of device IDs not recognized or supported by U-Boot, it maybe that flash is absent altogether.
Quoted 7 lines
But struct udevice * exists, so there is a device. Whether it is connected to something is a separate issue.
The problem is that
-ENODEVmeans that the device should not be created or should not exist.What happens if an invalid ID is returned? Does it unbind the device?
There are two cases:
1. spi flash node is present in the DT but there is no device on the board. In this case device is not unbound from DT node.
2. There is no flash device described as child of SPI bus but user tries sf probe (Or some U-boot code calls spi_flash_probe_bus_cs()). In this case a device is created on the fly and bound to sf driver and probe is attempted (as part of which attempt is make to read Device ID). If there is no flash found, then the device is unbound and removed (see drivers/mtd/spi/sf-uclass.c::spi_flash_probe_bus_cs and drivers/spi/spi-uclass.c::spi_get_bus_and_cs).
So at least in case 2 its U-boot which is creating device and try to look for it which would fail if not present. IMO, -ENODEV makes sense here since the intention is to dynamically find the device w/o an actual DT node present.
[...]
Regards
Vignesh
PATCH 2/31 mtd: spi-nor: Tidy up error handling / debug code
In reply to Simon GlassQuoted 10 lines · Simon Glass
The
-ENODEVerror value inspi_nor_read_id()is incorrect since there clearly is a device - it just cannot be supported. Use-ENOMEDIUMinstead which has the virtue of being less common.Fix the return value in
spi_nor_scan().Also there are a few
printf()statements which should bedebug()since they bloat the code with unused strings at present. Fix those while here.Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/b7a00c87/attachment.sig>
PATCH 3/31 wdt: Drop dm.h header file
In reply to Simon GlassThis 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")
---
include/wdt.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
include/wdt.h +1 -3
@@ -6,9 +6,7 @@#ifndef _WDT_H_#define _WDT_H_ -#include <dm.h> -#include <log.h> -#include <dm/read.h> +struct udevice ;/* * Implement a simple watchdog uclass. Watchdog is basically a timer that
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 3/31 wdt: Drop dm.h header file
Quoted 9 lines · Simon Glass
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 <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/93deb0b4/attachment.sig>
PATCH 4/31 mtd: spi-mem: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
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(-)
drivers/spi/spi-mem.c +6 -1
@@ -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__
drivers/spi/spi-sifive.c +1 -0
@@ -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>
drivers/spi/stm32_qspi.c +2 -0
@@ -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>
include/spi-mem.h +1 -4
@@ -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) \ { \
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 4/31 mtd: spi-mem: Drop dm.h header file
Quoted 4 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/235f487e/attachment.sig>
PATCH 5/31 mtd: spi: Drop SPI_XFER_MMAP*
In reply to Simon GlassThese two defines are no-longer supported. Drop them.
---
include/spi.h | 2 -- 1 file changed, 2 deletions(-)
include/spi.h +0 -2
@@ -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 */ };/**
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 5/31 mtd: spi: Drop SPI_XFER_MMAP*
Quoted 3 lines · Simon Glass
These two defines are no-longer supported. Drop them.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/be6b3ef0/attachment.sig>
PATCH 6/31 dm: core: Drop dm.h header file from dm-demo.h
In reply to Simon GlassThis header file should not be included in other header files. Remove it and add it to the cmd file instead.
---
cmd/demo.c | 1 + include/dm-demo.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)
cmd/demo.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <command.h> +#include <dm.h> #include <dm-demo.h> #include <mapmem.h> #include <asm/io.h>
include/dm-demo.h +0 -2
@@ -6,8 +6,6 @@#ifndef __DM_DEMO_H#define __DM_DEMO_H -#include <dm.h> -/** * struct dm_demo_pdata - configuration data for demo instance *
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 6/31 dm: core: Drop dm.h header file from dm-demo.h
Quoted 4 lines · Simon Glass
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 <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/3f9f50b9/attachment.sig>
PATCH 7/31 dm: core: Drop header files from dm/test.h
In reply to Simon GlassThese 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.
---
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(-)
include/dm/test.h +0 -3
@@ -6,9 +6,6 @@#ifndef __DM_TEST_H#define __DM_TEST_H -#include <dm.h> -#include <test/test.h> -/** * struct dm_test_cdata - configuration data for test instance *
include/test/ut.h +1 -0
@@ -11,6 +11,7 @@#include <command.h> #include <hexdump.h> #include <linux/err.h> +#include <test/test.h> struct unit_test_state ;
test/dm/adc.c +1 -0
@@ -17,6 +17,7 @@#include <power/regulator.h> #include <power/sandbox_pmic.h> #include <sandbox-adc.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_adc_bind (struct unit_test_state *uts)
test/dm/audio.c +1 -0
@@ -8,6 +8,7 @@#include <audio_codec.h> #include <dm.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> #include <asm/test.h>
test/dm/axi.c +2 -1
@@ -8,9 +8,10 @@#include <axi.h> #include <dm.h> #include <log.h> +#include <asm/axi.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <asm/axi.h> /* Test that sandbox AXI works correctly */ static int dm_test_axi_base (struct unit_test_state *uts)
test/dm/blk.c +1 -0
@@ -9,6 +9,7 @@#include <usb.h> #include <asm/state.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/board.c +1 -0
@@ -9,6 +9,7 @@#include <log.h> #include <dm/test.h> #include <board.h> +#include <test/test.h> #include <test/ut.h> #include "../../drivers/board/sandbox.h"
test/dm/bootcount.c +1 -0
@@ -9,6 +9,7 @@#include <log.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_bootcount (struct unit_test_state *uts)
test/dm/bus.c +1 -0
@@ -14,6 +14,7 @@#include <dm/test.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/clk.c +1 -0
@@ -12,6 +12,7 @@#include <dm/test.h> #include <dm/device-internal.h> #include <linux/err.h> +#include <test/test.h> #include <test/ut.h> /* Base test of the clk uclass */
test/dm/clk_ccf.c +1 -0
@@ -11,6 +11,7 @@#include <dm/test.h> #include <dm/uclass.h> #include <linux/err.h> +#include <test/test.h> #include <test/ut.h> #include <sandbox-clk.h>
test/dm/core.c +1 -0
@@ -16,6 +16,7 @@#include <dm/util.h> #include <dm/test.h> #include <dm/uclass-internal.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/cpu.c +1 -0
@@ -10,6 +10,7 @@#include <dm/test.h> #include <dm/uclass-internal.h> #include <cpu.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_cpu (struct unit_test_state *uts)
test/dm/dma.c +1 -0
@@ -11,6 +11,7 @@#include <malloc.h> #include <dm/test.h> #include <dma.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_dma_m2m (struct unit_test_state *uts)
test/dm/dsi_host.c +1 -0
@@ -10,6 +10,7 @@#include <asm/state.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_dsi_host_phy_init (void *priv_data)
test/dm/eth.c +2 -1
@@ -13,10 +13,11 @@#include <log.h> #include <malloc.h> #include <net.h> +#include <asm/eth.h> #include <dm/test.h> #include <dm/device-internal.h> #include <dm/uclass-internal.h> -#include <asm/eth.h> +#include <test/test.h> #include <test/ut.h> #define DM_TEST_ETH_NUM 4
test/dm/firmware.c +1 -0
@@ -8,6 +8,7 @@#include <syscon.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Base test of firmware probe */
test/dm/gpio.c +2 -1
@@ -9,10 +9,11 @@#include <log.h> #include <malloc.h> #include <acpi/acpi_device.h> +#include <asm/gpio.h> #include <dm/root.h> #include <dm/test.h> #include <dm/util.h> -#include <asm/gpio.h> +#include <test/test.h> #include <test/ut.h> /* Test that sandbox GPIOs work correctly */
test/dm/hwspinlock.c +1 -0
@@ -9,6 +9,7 @@#include <asm/state.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that hwspinlock driver functions are called */
test/dm/i2c.c +1 -0
@@ -16,6 +16,7 @@#include <dm/uclass-internal.h> #include <dm/util.h> #include <hexdump.h> +#include <test/test.h> #include <test/ut.h> static const int busnum;
test/dm/i2s.c +2 -1
@@ -7,9 +7,10 @@#include <common.h> #include <dm.h> #include <i2s.h> +#include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <asm/test.h> /* Basic test of the i2s codec uclass */ static int dm_test_i2s (struct unit_test_state *uts)
test/dm/led.c +1 -0
@@ -8,6 +8,7 @@#include <led.h> #include <asm/gpio.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Base test of the led uclass */
test/dm/mailbox.c +1 -0
@@ -8,6 +8,7 @@#include <malloc.h> #include <dm/test.h> #include <asm/mbox.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_mailbox (struct unit_test_state *uts)
test/dm/mdio.c +3 -2
@@ -7,10 +7,11 @@#include <common.h> #include <dm.h> #include <log.h> -#include <dm/test.h> +#include <miiphy.h> #include <misc.h> +#include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <miiphy.h> /* macros copied over from mdio_sandbox.c */ #define SANDBOX_PHY_ADDR 5
test/dm/mdio_mux.c +3 -2
@@ -6,10 +6,11 @@#include <common.h> #include <dm.h> -#include <dm/test.h> +#include <miiphy.h> #include <misc.h> +#include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <miiphy.h> /* macros copied over from mdio_sandbox.c */ #define SANDBOX_PHY_ADDR 5
test/dm/misc.c +1 -0
@@ -8,6 +8,7 @@#include <dm.h> #include <dm/test.h> #include <misc.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_misc (struct unit_test_state *uts)
test/dm/mmc.c +1 -0
@@ -8,6 +8,7 @@#include <mmc.h> #include <part.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /*
test/dm/nop.c +1 -0
@@ -13,6 +13,7 @@#include <dm/device.h> #include <dm/test.h> #include <misc.h> +#include <test/test.h> #include <test/ut.h> static int noptest_bind (struct udevice *parent)
test/dm/ofnode.c +1 -0
@@ -5,6 +5,7 @@#include <log.h> #include <dm/of_extra.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_ofnode_compatible (struct unit_test_state *uts)
test/dm/osd.c +3 -2
@@ -7,10 +7,11 @@#include <common.h> #include <display_options.h> #include <dm.h> -#include <dm/test.h> -#include <test/ut.h> #include <video_osd.h> #include <asm/test.h> +#include <dm/test.h> +#include <test/test.h> +#include <test/ut.h> #include "../../drivers/video/sandbox_osd.h"
test/dm/panel.c +2 -1
@@ -14,8 +14,9 @@#include <asm/gpio.h> #include <asm/test.h> #include <dm/test.h> -#include <test/ut.h> #include <power/regulator.h> +#include <test/test.h> +#include <test/ut.h> /* Basic test of the panel uclass */ static int dm_test_panel (struct unit_test_state *uts)
test/dm/pch.c +1 -0
@@ -8,6 +8,7 @@#include <pch.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that sandbox PCH works correctly */
test/dm/pci.c +1 -0
@@ -8,6 +8,7 @@#include <asm/io.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that sandbox PCI works correctly */
test/dm/pci_ep.c +3 -2
@@ -5,12 +5,13 @@#include <common.h> #include <dm.h> +#include <hexdump.h> +#include <pci_ep.h> #include <asm/io.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <hexdump.h> -#include <pci_ep.h> /* Test that sandbox PCI EP works correctly */ static int dm_test_pci_ep_base (struct unit_test_state *uts)
test/dm/phy.c +1 -0
@@ -9,6 +9,7 @@#include <generic-phy.h> #include <log.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Base test of the phy uclass */
test/dm/pmic.c +3 -2
@@ -10,16 +10,17 @@#include <errno.h> #include <dm.h> #include <fdtdec.h> +#include <fsl_pmic.h> #include <malloc.h> #include <dm/device-internal.h> #include <dm/root.h> -#include <dm/util.h> #include <dm/test.h> #include <dm/uclass-internal.h> +#include <dm/util.h> #include <power/pmic.h> #include <power/sandbox_pmic.h> +#include <test/test.h> #include <test/ut.h> -#include <fsl_pmic.h> /* Test PMIC get method */
test/dm/power-domain.c +1 -0
@@ -8,6 +8,7 @@#include <malloc.h> #include <dm/test.h> #include <asm/power-domain.h> +#include <test/test.h> #include <test/ut.h> /* This must match the specifier for power-domains in the DT node */
test/dm/pwm.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <pwm.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Basic test of the pwm uclass */
test/dm/ram.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <ram.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/regmap.c +1 -0
@@ -12,6 +12,7 @@#include <asm/test.h> #include <dm/test.h> #include <linux/err.h> +#include <test/test.h> #include <test/ut.h> /* Base test of register maps */
test/dm/regulator.c +1 -0
@@ -20,6 +20,7 @@#include <power/pmic.h> #include <power/regulator.h> #include <power/sandbox_pmic.h> +#include <test/test.h> #include <test/ut.h> enum {
test/dm/remoteproc.c +2 -0
@@ -10,7 +10,9 @@#include <remoteproc.h> #include <asm/io.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> +/** * dm_test_remoteproc_base() - test the operations after initializations * @uts: unit test state
test/dm/reset.c +1 -0
@@ -10,6 +10,7 @@#include <reset.h> #include <dm/test.h> #include <asm/reset.h> +#include <test/test.h> #include <test/ut.h> /* This must match the specifier for mbox-names="test" in the DT node */
test/dm/rtc.c +1 -0
@@ -14,6 +14,7 @@#include <asm/rtc.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Simple RTC sanity check */
test/dm/serial.c +1 -0
@@ -8,6 +8,7 @@#include <serial.h> #include <dm.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_serial (struct unit_test_state *uts)
test/dm/sf.c +1 -0
@@ -15,6 +15,7 @@#include <asm/test.h> #include <dm/test.h> #include <dm/util.h> +#include <test/test.h> #include <test/ut.h> /* Simple test of sandbox SPI flash */
test/dm/smem.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <smem.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Basic test of the smem uclass */
test/dm/sound.c +1 -0
@@ -9,6 +9,7 @@#include <sound.h> #include <dm/test.h> #include <test/ut.h> +#include <test/test.h> #include <asm/test.h> /* Basic test of the sound codec uclass */
test/dm/spi.c +1 -0
@@ -13,6 +13,7 @@#include <dm/test.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <test/test.h> #include <test/ut.h> /* Test that we can find buses and chip-selects */
test/dm/spmi.c +1 -0
@@ -14,6 +14,7 @@#include <power/pmic.h> #include <spmi/spmi.h> #include <asm/gpio.h> +#include <test/test.h> #include <test/ut.h> /* Test if bus childs got probed propperly*/
test/dm/syscon.c +1 -0
@@ -11,6 +11,7 @@#include <asm/test.h> #include <dm/test.h> #include <linux/err.h> +#include <test/test.h> #include <test/ut.h> /* Base test of system controllers */
test/dm/sysreset.c +1 -0
@@ -9,6 +9,7 @@#include <asm/state.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that we can use particular sysreset devices */
test/dm/tee.c +1 -0
@@ -10,6 +10,7 @@#include <dm/test.h> #include <sandboxtee.h> #include <tee.h> +#include <test/test.h> #include <test/ut.h> #include <tee/optee_ta_avb.h>
test/dm/test-driver.c +2 -1
@@ -11,9 +11,10 @@#include <errno.h> #include <log.h> #include <malloc.h> +#include <asm/io.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <asm/io.h> int dm_testdrv_op_count[DM_TEST_OP_COUNT ];static struct unit_test_state *uts = &global_dm_test_state;
test/dm/test-fdt.c +1 -0
@@ -18,6 +18,7 @@#include <dm/util.h> #include <dm/lists.h> #include <dm/of_access.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/test-main.c +2 -0
@@ -14,6 +14,8 @@#include <dm/test.h> #include <dm/root.h> #include <dm/uclass-internal.h> +#include <test/test.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/test-uclass.c +1 -0
@@ -14,6 +14,7 @@#include <asm/io.h> #include <dm/test.h> #include <linux/list.h> +#include <test/test.h> #include <test/ut.h> static struct unit_test_state *uts = &global_dm_test_state;
test/dm/timer.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <timer.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /*
test/dm/usb.c +1 -0
@@ -14,6 +14,7 @@#include <dm/device-internal.h> #include <dm/test.h> #include <dm/uclass-internal.h> +#include <test/test.h> #include <test/ut.h> struct keyboard_test_data {
test/dm/video.c +1 -0
@@ -15,6 +15,7 @@#include <video_console.h> #include <dm/test.h> #include <dm/uclass-internal.h> +#include <test/test.h> #include <test/ut.h> /*
test/dm/virtio.c +2 -1
@@ -9,9 +9,10 @@#include <virtio.h> #include <virtio_ring.h> #include <dm/device-internal.h> -#include <dm/uclass-internal.h> #include <dm/root.h> #include <dm/test.h> +#include <dm/uclass-internal.h> +#include <test/test.h> #include <test/ut.h> /* Basic test of the virtio uclass */
test/dm/wdt.c +1 -0
@@ -9,6 +9,7 @@#include <asm/state.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that watchdog driver functions are called */
test/lib/lmb.c +2 -0
@@ -4,10 +4,12 @@*/ #include <common.h> +#include <dm.h> #include <lmb.h> #include <log.h> #include <malloc.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int check_lmb(struct unit_test_state *uts, struct lmb *lmb,
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 7/31 dm: core: Drop header files from dm/test.h
Quoted 5 lines · Simon Glass
These header file should not be included in other header files. Remove them and add to each individual file. Add
test/test.htotest/ui.hsince that is a reasonable place.Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/d80d5b30/attachment.sig>
PATCH 8/31 fs: fs-loader: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
drivers/fpga/socfpga_arria10.c | 1 + include/fs_loader.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/fpga/socfpga_arria10.c +1 -0
@@ -13,6 +13,7 @@#include <altera.h> #include <asm/arch/pinmux.h> #include <common.h> +#include <dm.h> #include <dm/ofnode.h> #include <errno.h> #include <fs_loader.h>
include/fs_loader.h +1 -1
@@ -6,7 +6,7 @@#ifndef _FS_LOADER_H_#define _FS_LOADER_H_ -#include <dm.h> +struct udevice ;/** * struct phandle_part - A place for storing phandle of node and its partition
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 8/31 fs: fs-loader: Drop dm.h header file
Quoted 4 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/d81e78e4/attachment.sig>
PATCH 9/31 net: Drop dm.h header file from phy.h
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use other headers and C inclusions instead.
---
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(-)
cmd/mdio.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <command.h> +#include <dm.h> #include <miiphy.h> #include <phy.h>
cmd/mii.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <command.h> +#include <dm.h> #include <miiphy.h> typedef struct _MII_field_desc_t {
include/dm/read.h +1 -0
@@ -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>
include/phy.h +6 -3
@@ -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
include/phy_interface.h +2 -0
@@ -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,
net/eth_legacy.c +1 -0
@@ -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>
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 9/31 net: Drop dm.h header file from phy.h
Quoted 4 lines · Simon Glass
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 <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/fcd6e6b5/attachment.sig>
PATCH 10/31 sf: Drop dm.h header file from spi_flash.h
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
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(-)
arch/arm/mach-k3/sysfw-loader.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <dm.h> #include <image.h> #include <log.h> #include <spl.h>
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <console.h> +#include <dm.h> #include <dfu.h> #include <malloc.h> #include <serial.h>
arch/x86/cpu/ivybridge/sdram.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <dm.h> #include <errno.h> #include <fdtdec.h> #include <init.h>
board/st/common/stm32mp_dfu.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <blk.h> +#include <dm.h> #include <dfu.h> #include <env.h> #include <memalign.h>
include/spi_flash.h +2 -1
@@ -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
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 10/31 sf: Drop dm.h header file from spi_flash.h
Quoted 4 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/d32e5925/attachment.sig>
PATCH 11/31 thermal: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
arch/arm/mach-imx/cpu.c | 1 + include/thermal.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-imx/cpu.c +1 -0
@@ -8,6 +8,7 @@#include <bootm.h> #include <common.h> +#include <dm.h> #include <init.h> #include <log.h> #include <net.h>
include/thermal.h +1 -1
@@ -7,7 +7,7 @@#ifndef _THERMAL_H_#define _THERMAL_H_ -#include <dm.h> +struct udevice ;int thermal_get_temp (struct udevice *dev,int *temp);
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 11/31 thermal: Drop dm.h header file
Quoted 4 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/9df6eef9/attachment.sig>
PATCH 12/31 w1: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
board/atmel/common/board.c | 1 + cmd/w1.c | 1 + include/w1.h | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-)
board/atmel/common/board.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <dm.h> #include <env.h> #include <w1.h> #include <w1-eeprom.h>
cmd/w1.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> #include <command.h> +#include <dm.h> #include <w1.h> #include <w1-eeprom.h> #include <dm/device-internal.h>
include/w1.h +1 -1
@@ -8,7 +8,7 @@#ifndef __W1_H#define __W1_H -#include <dm.h> +struct udevice ;#define W1_FAMILY_DS24B33 0x23#define W1_FAMILY_DS2431 0x2d
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 12/31 w1: Drop dm.h header file
Quoted 4 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/6da0a079/attachment.sig>
PATCH 13/31 efi: Tidy up header includes
In reply to Simon GlassTwo 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.
---
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(-)
include/efi_driver.h +0 -2
@@ -8,8 +8,6 @@#ifndef _EFI_DRIVER_H#define _EFI_DRIVER_H 1 -#include <common.h> -#include <dm.h> #include <efi_loader.h> /*
lib/efi_driver/efi_block_device.c +1 -0
@@ -30,6 +30,7 @@#include <common.h> #include <blk.h> +#include <dm.h> #include <efi_driver.h> #include <malloc.h> #include <dm/device-internal.h>
lib/efi_driver/efi_uclass.c +2 -0
@@ -17,6 +17,8 @@* controllers. */ +#include <common.h> +#include <dm.h> #include <efi_driver.h> #include <log.h> #include <malloc.h>
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 13/31 efi: Tidy up header includes
Quoted 5 lines · Simon Glass
Two files relies on
efi_driver.hto includecommon.handdm.hwhich 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 <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/675e1791/attachment.sig>
PATCH 14/31 power: Tidy up inclusion of regulator_common.h
In reply to Simon GlassThis file should not include common.h and dm.h so remove them. Also move the inclusion of this file to after the normal includes.
---
drivers/power/regulator/fixed.c | 3 ++- drivers/power/regulator/gpio-regulator.c | 3 ++- drivers/power/regulator/regulator_common.c | 4 +++- drivers/power/regulator/regulator_common.h | 2 -- 4 files changed, 7 insertions(+), 5 deletions(-)
drivers/power/regulator/fixed.c +2 -1
@@ -5,7 +5,6 @@* Przemyslaw Marczak <[email protected]> */ -#include "regulator_common.h" #include <common.h> #include <errno.h> #include <dm.h>
@@ -13,6 +12,8 @@#include <power/pmic.h> #include <power/regulator.h> +#include "regulator_common.h" +static int fixed_regulator_ofdata_to_platdata (struct udevice *dev) {struct dm_regulator_uclass_platdata *uc_pdata;
drivers/power/regulator/gpio-regulator.c +2 -1
@@ -4,7 +4,6 @@* Keerthy <[email protected]> */ -#include "regulator_common.h" #include <common.h> #include <fdtdec.h> #include <errno.h>
@@ -15,6 +14,8 @@#include <power/pmic.h> #include <power/regulator.h> +#include "regulator_common.h" +#define GPIO_REGULATOR_MAX_STATES 2DECLARE_GLOBAL_DATA_PTR ;
drivers/power/regulator/regulator_common.c +3 -1
@@ -4,12 +4,14 @@* Sven Schwermer <[email protected]> */ -#include "regulator_common.h" #include <common.h> +#include <dm.h> #include <log.h> #include <linux/delay.h> #include <power/regulator.h> +#include "regulator_common.h" +int regulator_common_ofdata_to_platdata (struct udevice *dev,struct regulator_common_platdata *dev_pdata,const char *enable_gpio_name) {
drivers/power/regulator/regulator_common.h +0 -2
@@ -7,9 +7,7 @@ #ifndef _REGULATOR_COMMON_H #define _REGULATOR_COMMON_H -#include <common.h> #include <asm/gpio.h> -#include <dm.h> struct regulator_common_platdata { struct gpio_desc gpio; /* GPIO for regulator enable control */
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 14/31 power: Tidy up inclusion of regulator_common.h
Quoted 4 lines · Simon Glass
This file should not include
common.handdm.hso remove them. Also move the inclusion of this file to after the normal includes.Signed-off-by Simon Glass <[email protected]>
Best Regards,
Jaehoon Chung
Quoted 85 lines
---
drivers/power/regulator/fixed.c | 3 ++- drivers/power/regulator/gpio-regulator.c | 3 ++- drivers/power/regulator/regulator_common.c | 4 +++- drivers/power/regulator/regulator_common.h | 2 -- 4 files changed, 7 insertions(+), 5 deletions(-)drivers/power/regulator/fixed.c +2
-1@@ -5,7 +5,6 @@* Przemyslaw Marczak <[email protected]> */ -#include "regulator_common.h" #include <common.h> #include <errno.h> #include <dm.h> @@ -13,6 +12,8 @@#include <power/pmic.h> #include <power/regulator.h> +#include "regulator_common.h" +static int fixed_regulator_ofdata_to_platdata (struct udevice *dev) {struct dm_regulator_uclass_platdata *uc_pdata;drivers/power/regulator/gpio-regulator.c +2
-1@@ -4,7 +4,6 @@* Keerthy <[email protected]> */ -#include "regulator_common.h" #include <common.h> #include <fdtdec.h> #include <errno.h> @@ -15,6 +14,8 @@#include <power/pmic.h> #include <power/regulator.h> +#include "regulator_common.h" +#define GPIO_REGULATOR_MAX_STATES 2DECLARE_GLOBAL_DATA_PTR ;drivers/power/regulator/regulator_common.c +3
-1@@ -4,12 +4,14 @@* Sven Schwermer <[email protected]> */ -#include "regulator_common.h" #include <common.h> +#include <dm.h> #include <log.h> #include <linux/delay.h> #include <power/regulator.h> +#include "regulator_common.h" +int regulator_common_ofdata_to_platdata (struct udevice *dev,struct regulator_common_platdata *dev_pdata,const char *enable_gpio_name) {drivers/power/regulator/regulator_common.h +0
-2@@ -7,9 +7,7 @@ #ifndef _REGULATOR_COMMON_H #define _REGULATOR_COMMON_H -#include <common.h> #include <asm/gpio.h> -#include <dm.h> struct regulator_common_platdata { struct gpio_desc gpio; /* GPIO for regulator enable control */
PATCH 14/31 power: Tidy up inclusion of regulator_common.h
In reply to Simon GlassQuoted 5 lines · Simon Glass
This file should not include
common.handdm.hso remove them. Also move the inclusion of this file to after the normal includes.Signed-off-by Simon Glass <[email protected]>Reviewed-by Jaehoon Chung <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/95b79eda/attachment.sig>
PATCH 15/31 mmc: Drop duplicate dm.h inclusion
In reply to Simon GlassWe only need to include this header once. Drop the duplicate.
---
drivers/mmc/sdhci.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/sdhci.c +0 -1
@@ -15,7 +15,6 @@#include <malloc.h> #include <mmc.h> #include <sdhci.h> -#include <dm.h> #include <asm/cache.h> #include <linux/bitops.h> #include <linux/delay.h>
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 15/31 mmc: Drop duplicate dm.h inclusion
Quoted 3 lines · Simon Glass
We only need to include this header once. Drop the duplicate.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/3222fb67/attachment.sig>
PATCH 16/31 spi: Drop duplicate dm.h inclusion
In reply to Simon GlassWe only need to include this header once. Drop the duplicate.
---
drivers/spi/mscc_bb_spi.c | 1 - 1 file changed, 1 deletion(-)
drivers/spi/mscc_bb_spi.c +0 -1
@@ -11,7 +11,6 @@#include <log.h> #include <malloc.h> #include <spi.h> -#include <dm.h> #include <asm/gpio.h> #include <asm/io.h> #include <linux/bitops.h>
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 16/31 spi: Drop duplicate dm.h inclusion
Quoted 3 lines · Simon Glass
We only need to include this header once. Drop the duplicate.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/fb0d6a27/attachment.sig>
PATCH 17/31 ti: am654: Drop duplicate dm.h inclusion
In reply to Simon GlassWe only need to include this header once. Drop the duplicate.
---
drivers/ram/k3-am654-ddrss.c | 1 - 1 file changed, 1 deletion(-)
drivers/ram/k3-am654-ddrss.c +0 -1
@@ -13,7 +13,6 @@#include <ram.h> #include <asm/io.h> #include <power-domain.h> -#include <dm.h> #include <asm/arch/sys_proto.h> #include <dm/device_compat.h> #include <power/regulator.h>
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 17/31 ti: am654: Drop duplicate dm.h inclusion
Quoted 3 lines · Simon Glass
We only need to include this header once. Drop the duplicate.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/6080ffb4/attachment.sig>
PATCH 18/31 liebherr: Drop duplicate dm.h inclusion
In reply to Simon GlassWe only need to include this header once. Drop the duplicate.
---
board/liebherr/display5/display5.c | 1 - 1 file changed, 1 deletion(-)
board/liebherr/display5/display5.c +0 -1
@@ -27,7 +27,6 @@#include <i2c.h> #include <linux/delay.h> -#include <dm.h> #include <dm/platform_data/serial_mxc.h> #include <dm/platdata.h>
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 18/31 liebherr: Drop duplicate dm.h inclusion
Quoted 3 lines · Simon Glass
We only need to include this header once. Drop the duplicate.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/7bc1d85e/attachment.sig>
PATCH 19/31 pci: Drop dm.h inclusion from header file
In reply to Simon GlassThe layerscape header should not include dm.h so remove it.
---
drivers/pci/pcie_layerscape.h | 1 - drivers/pci/pcie_layerscape_fixup.c | 1 + drivers/pci/pcie_layerscape_gen4.h | 1 - drivers/pci/pcie_layerscape_gen4_fixup.c | 1 + 4 files changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pcie_layerscape.h +0 -1
@@ -8,7 +8,6 @@#ifndef _PCIE_LAYERSCAPE_H_#define _PCIE_LAYERSCAPE_H_#include <pci.h> -#include <dm.h> #ifndef CONFIG_SYS_PCI_MEMORY_BUS #define CONFIG_SYS_PCI_MEMORY_BUS CONFIG_SYS_SDRAM_BASE
drivers/pci/pcie_layerscape_fixup.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <dm.h> #include <init.h> #include <log.h> #include <pci.h>
drivers/pci/pcie_layerscape_gen4.h +0 -1
@@ -9,7 +9,6 @@#ifndef _PCIE_LAYERSCAPE_GEN4_H_#define _PCIE_LAYERSCAPE_GEN4_H_#include <pci.h> -#include <dm.h> #include <linux/bitops.h> #ifndef CONFIG_SYS_PCI_MEMORY_SIZE
drivers/pci/pcie_layerscape_gen4_fixup.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <dm.h> #include <log.h> #include <pci.h> #include <asm/arch/fsl_serdes.h>
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 19/31 pci: Drop dm.h inclusion from header file
Quoted 3 lines · Simon Glass
The layerscape header should not include
dm.hso remove it.Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/53055370/attachment.sig>
PATCH 20/31 mediatek: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
arch/arm/include/asm/arch-mediatek/reset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/arch-mediatek/reset.h +1 -1
@@ -6,7 +6,7 @@#ifndef __MEDIATEK_RESET_H#define __MEDIATEK_RESET_H -#include <dm.h> +struct udevice ;int mediatek_reset_bind (struct udevice *pdev,u32 regofs,u32 num_regs);
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 20/31 mediatek: Drop dm.h header file
Quoted 4 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/1bc6f800/attachment.sig>
PATCH 21/31 mscc: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it from each one and use a forward declaration instead.
---
arch/mips/mach-mscc/include/mach/jr2/jr2.h | 3 --- arch/mips/mach-mscc/include/mach/luton/luton.h | 3 --- arch/mips/mach-mscc/include/mach/ocelot/ocelot.h | 3 --- arch/mips/mach-mscc/include/mach/serval/serval.h | 3 --- arch/mips/mach-mscc/include/mach/servalt/servalt.h | 3 --- board/mscc/servalt/servalt.c | 2 ++ 6 files changed, 2 insertions(+), 15 deletions(-)
arch/mips/mach-mscc/include/mach/jr2/jr2.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_JR2_H_#define _MSCC_JR2_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
arch/mips/mach-mscc/include/mach/luton/luton.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_OCELOT_H_#define _MSCC_OCELOT_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
arch/mips/mach-mscc/include/mach/ocelot/ocelot.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_OCELOT_H_#define _MSCC_OCELOT_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
arch/mips/mach-mscc/include/mach/serval/serval.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_SERVAL_H_#define _MSCC_SERVAL_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
arch/mips/mach-mscc/include/mach/servalt/servalt.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_SERVALT_H_#define _MSCC_SERVALT_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
board/mscc/servalt/servalt.c +2 -0
@@ -9,6 +9,8 @@#include <asm/io.h> #include <led.h> +DECLARE_GLOBAL_DATA_PTR ; +enum {BOARD_TYPE_PCB116 =0xAABBCE00 , };
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 21/31 mscc: Drop dm.h header file
Quoted 4 lines · Simon Glass
This header file should not be included in other header files. Remove it from each one and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/a0761036/attachment.sig>
PATCH 22/31 adc: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
Drop the common.h inclusion also.
---
drivers/adc/stm32-adc-core.c | 1 + drivers/adc/stm32-adc-core.h | 4 ++-- drivers/adc/stm32-adc.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/adc/stm32-adc-core.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <dm.h> #include <asm/io.h> #include <dm/device_compat.h> #include <linux/bitops.h>
drivers/adc/stm32-adc-core.h +2 -2
@@ -26,9 +26,9 @@#define STM32_ADC_MAX_ADCS 3#define STM32_ADCX_COMN_OFFSET 0x300 -#include <common.h> #include <clk.h> -#include <dm.h> + +struct udevice ;/** * struct stm32_adc_common - stm32 ADC driver common data (for all instances)
drivers/adc/stm32-adc.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <adc.h> +#include <dm.h> #include <asm/io.h> #include <dm/device_compat.h> #include <linux/bitops.h>
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 22/31 adc: Drop dm.h header file
Quoted 6 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Drop the
common.hinclusion also.Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/16a00a0e/attachment-0001.sig>
PATCH 23/31 nand: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c | 1 + drivers/mtd/nand/raw/brcmnand/brcmnand_compat.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ #include <common.h> +#include <dm.h> #include <malloc.h> #include <dm/devres.h> #include "brcmnand_compat.h"
drivers/mtd/nand/raw/brcmnand/brcmnand_compat.h +2 -2
@@ -3,8 +3,8 @@#ifndef __BRCMNAND_COMPAT_H#define __BRCMNAND_COMPAT_H -#include <clk.h> -#include <dm.h> +struct clk ; +struct udevice ;char *devm_kasprintf (struct udevice *dev,gfp_t gfp,const char *fmt, ...);
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 23/31 nand: Drop dm.h header file
Quoted 4 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/2714a7dd/attachment.sig>
PATCH 24/31 ufs: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
Also drop asm/io.h
---
drivers/ufs/cdns-platform.c | 1 + drivers/ufs/ufs.c | 3 ++- drivers/ufs/ufs.h | 5 ++--- 3 files changed, 5 insertions(+), 4 deletions(-)
drivers/ufs/cdns-platform.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <dm.h> #include <ufs.h> +#include <asm/io.h> #include <dm/device_compat.h> #include <linux/bitops.h> #include <linux/err.h>
drivers/ufs/ufs.c +2 -1
@@ -19,9 +19,10 @@#include <malloc.h> #include <hexdump.h> #include <scsi.h> +#include <asm/io.h> +#include <asm/dma-mapping.h> #include <linux/bitops.h> #include <linux/delay.h> -#include <linux/dma-mapping.h> #include "ufs.h"
drivers/ufs/ufs.h +2 -3
@@ -2,11 +2,10 @@#ifndef __UFS_H#define __UFS_H -#include <asm/io.h> -#include <dm.h> -#include "unipro.h" +struct udevice ; +#define UFS_CDB_SIZE 16#define UPIU_TRANSACTION_UIC_CMD 0x1F#define UIC_CMD_SIZE (sizeof(u32) * 4)
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 24/31 ufs: Drop dm.h header file
Quoted 6 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Also drop
asm/io.hSigned-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/b28a63ca/attachment.sig>
PATCH 25/31 usb: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
Also move the inline function out into a C file. We should not include C code in headers.
---
drivers/usb/musb-new/musb_uboot.c | 37 +++++++++++++++++++++++++ drivers/usb/musb-new/pic32.c | 1 + drivers/usb/musb-new/usb-compat.h | 45 +++++++------------------------ 3 files changed, 47 insertions(+), 36 deletions(-)
drivers/usb/musb-new/musb_uboot.c +37 -0
@@ -1,5 +1,6 @@#include <common.h> #include <console.h> +#include <dm.h> #include <malloc.h> #include <watchdog.h> #include <linux/delay.h>
@@ -452,3 +453,39 @@ struct musb *musb_register(struct musb_hdrc_platform_data *plat, void *bdata,return *musbp; } + +#if CONFIG_IS_ENABLED (DM_USB ) +struct usb_device *usb_dev_get_parent (struct usb_device *udev) +{ +struct udevice *parent = udev->dev->parent; + +/* +* When called from usb-uclass.c: usb_scan_device() udev->dev points +* to the parent udevice, not the actual udevice belonging to the +* udev as the device is not instantiated yet. +* +* If dev is an usb-bus, then we are called from usb_scan_device() for +* an usb-device plugged directly into the root port, return NULL. +*/ +if (device_get_uclass_id (udev->dev) ==UCLASS_USB ) +return NULL ; + +/* +* If these 2 are not the same we are being called from +* usb_scan_device() and udev itself is the parent. +*/ +if (dev_get_parent_priv (udev->dev) != udev) +return udev; + +/* We are being called normally, use the parent pointer */ +if (device_get_uclass_id (parent) ==UCLASS_USB_HUB ) +return dev_get_parent_priv (parent); + +return NULL ; +} +#else +struct usb_device *usb_dev_get_parent (struct usb_device *udev) +{ +return udev->parent; +} +#endif
drivers/usb/musb-new/pic32.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <dm.h> #include <dm/device_compat.h> #include <linux/bitops.h> #include <linux/delay.h>
drivers/usb/musb-new/usb-compat.h +9 -36
58 lines not on this page · raw message
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 25/31 usb: Drop dm.h header file
Quoted 7 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Also move the inline function out into a C file. We should not include C code in headers.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/975a5452/attachment.sig>
PATCH 26/31 clk: Drop dm.h header file in clk-provider.h
In reply to Simon GlassThis 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.
---
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(-)
drivers/clk/clk-uclass.c +5 -0
@@ -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,
drivers/clk/kendryte/bypass.c +5 -2
@@ -4,12 +4,15 @@*/ #define LOG_CATEGORY UCLASS_CLK -#include <kendryte/bypass.h> +#include <common.h> +#include <clk.h> #include <clk-uclass.h> +#include <dm.h> +#include <log.h> +#include <kendryte/bypass.h> #include <linux/clk-provider.h> #include <linux/err.h> -#include <log.h> #define CLK_K210_BYPASS "k210_clk_bypass"
drivers/clk/kendryte/pll.c +6 -4
@@ -3,18 +3,20 @@* Copyright (C) 2019-20 Sean Anderson <[email protected]> */ #define LOG_CATEGORY UCLASS_CLK -#include <kendryte/pll.h> -#include <asm/io.h> +#include <common.h> +#include <dm.h> /* For DIV_ROUND_DOWN_ULL, defined in linux/kernel.h */ #include <div64.h> +#include <log.h> +#include <serial.h> +#include <asm/io.h> #include <dt-bindings/clock/k210-sysctl.h> +#include <kendryte/pll.h> #include <linux/bitfield.h> #include <linux/clk-provider.h> #include <linux/delay.h> #include <linux/err.h> -#include <log.h> -#include <serial.h> #define CLK_K210_PLL "k210_clk_pll"
include/kendryte/bypass.h +1 -1
@@ -5,7 +5,7 @@ #ifndef K210_BYPASS_H #define K210_BYPASS_H -#include <clk.h> +struct clk; struct k210_bypass { struct clk clk;
include/linux/clk-provider.h +3 -5
@@ -9,12 +9,13 @@#ifndef __LINUX_CLK_PROVIDER_H#define __LINUX_CLK_PROVIDER_H -#include <dm.h> #include <linux/bitops.h> #include <linux/err.h> #include <clk-uclass.h> #include <linux/err.h> +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 */
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 26/31 clk: Drop dm.h header file in clk-provider.h
Quoted 117 lines · Simon Glass
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 <[email protected]>---
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(-)drivers/clk/clk-uclass.c +5
-0@@ -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,drivers/clk/kendryte/bypass.c +5
-2@@ -4,12 +4,15 @@*/ #define LOG_CATEGORY UCLASS_CLK -#include <kendryte/bypass.h> +#include <common.h> +#include <clk.h> #include <clk-uclass.h> +#include <dm.h> +#include <log.h> +#include <kendryte/bypass.h> #include <linux/clk-provider.h> #include <linux/err.h> -#include <log.h> #define CLK_K210_BYPASS "k210_clk_bypass"drivers/clk/kendryte/pll.c +6
-4@@ -3,18 +3,20 @@* Copyright (C) 2019-20 Sean Anderson <[email protected]> */ #define LOG_CATEGORY UCLASS_CLK -#include <kendryte/pll.h> -#include <asm/io.h> +#include <common.h> +#include <dm.h> /* For DIV_ROUND_DOWN_ULL, defined in linux/kernel.h */ #include <div64.h> +#include <log.h> +#include <serial.h> +#include <asm/io.h> #include <dt-bindings/clock/k210-sysctl.h> +#include <kendryte/pll.h> #include <linux/bitfield.h> #include <linux/clk-provider.h> #include <linux/delay.h> #include <linux/err.h> -#include <log.h> -#include <serial.h> #define CLK_K210_PLL "k210_clk_pll"include/kendryte/bypass.h +1
-1@@ -5,7 +5,7 @@ #ifndef K210_BYPASS_H #define K210_BYPASS_H -#include <clk.h> +struct clk; struct k210_bypass { struct clk clk;include/linux/clk-provider.h +2
-1@@ -9,12 +9,13 @@#ifndef __LINUX_CLK_PROVIDER_H#define __LINUX_CLK_PROVIDER_H -#include <dm.h> #include <linux/bitops.h> #include <linux/err.h> #include <clk-uclass.h> #include <linux/err.h> +struct udevice ; +static inline void clk_dm (ulong id,struct clk *clk) {if (!IS_ERR (clk))
include/linux/clk-provider.h struct clk *clk_register_mux(struct device *dev, const char *name, · line 193
Quoted 9 lines
include/linux/clk-provider.h +1
-4@@ -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 */
PATCH 26/31 clk: Drop dm.h header file in clk-provider.h
In reply to Simon GlassQuoted 8 lines · Simon Glass
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 <[email protected]>Reviewed-by Sean Anderson <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/20c701d8/attachment.sig>
PATCH 27/31 net: Drop dm.h header file in eth_phy.h
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
include/eth_phy.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/eth_phy.h +2 -1
@@ -6,9 +6,10 @@#ifndef _eth_phy_h_#define _eth_phy_h_ -#include <dm.h> #include <phy.h> +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);
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 27/31 net: Drop dm.h header file in eth_phy.h
Quoted 4 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/abb510a0/attachment.sig>
PATCH 28/31 net: Drop duplicate include of dm.h in pcnet.c
In reply to Simon GlassThis file includes the header twice. Drop the second one.
---
drivers/net/pcnet.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/pcnet.c +0 -1
@@ -10,7 +10,6 @@#include <cpu_func.h> #include <dm.h> #include <log.h> -#include <dm.h> #include <malloc.h> #include <memalign.h> #include <net.h>
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 28/31 net: Drop duplicate include of dm.h in pcnet.c
Quoted 3 lines · Simon Glass
This file includes the header twice. Drop the second one.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/1b4542db/attachment.sig>
PATCH 29/31 dm: core: Guard against including dm.h in header files
In reply to Simon GlassHeader 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.
---
include/dm.h | 4 ++++ 1 file changed, 4 insertions(+)
include/dm.h +4 -0
@@ -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_
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 29/31 dm: core: Guard against including dm.h in header files
Quoted 6 lines · Simon Glass
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.hbeing included, since this has crept into U-Boot.Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/0b1efd2b/attachment.sig>
PATCH 30/31 patman: Fix up the test comments
In reply to Simon GlassMany of the tests have the same comment and two have the same name. Fix this.
---
tools/patman/test_checkpatch.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tools/patman/test_checkpatch.py +5 -5
@@ -373,19 +373,19 @@ index 0000000..2234c87 self.checkSingleMessage(pm, 'NEW_UCLASS') def testLivetree(self): - """Test for Use the livetree API""" + """Test for using the livetree API""" pm = PatchMaker() pm.add_line('common/main.c', 'fdtdec_do_something()') self.checkSingleMessage(pm, 'LIVETREE') def testNewCommand(self): - """Test for Use the livetree API""" + """Test for adding a new command""" pm = PatchMaker() pm.add_line('common/main.c', 'do_wibble(struct cmd_tbl *cmd_tbl)') self.checkSingleMessage(pm, 'CMD_TEST') - def testNewCommand(self): - """Test for Use the livetree API""" + def testPreferIf(self): + """Test for using #ifdef""" pm = PatchMaker() pm.add_line('common/main.c', '#ifdef CONFIG_YELLOW') pm.add_line('common/init.h', '#ifdef CONFIG_YELLOW')
@@ -393,7 +393,7 @@ index 0000000..2234c87 self.checkSingleMessage(pm, "PREFER_IF") def testCommandUseDefconfig(self): - """Test for Use the livetree API""" + """Test for enabling/disabling commands using preprocesor""" pm = PatchMaker() pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH') self.checkSingleMessage(pm, 'DEFINE_CONFIG_CMD', 'error')
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 30/31 patman: Fix up the test comments
Quoted 4 lines · Simon Glass
Many of the tests have the same comment and two have the same name. Fix this.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/d8ee339a/attachment.sig>
PATCH 31/31 checkpatch: Don't allow common.h and dm.h in headers
In reply to Simon GlassThese headers should not be included in other header files. Add a checkpatch rule and test for this.
---
scripts/checkpatch.pl | 10 ++++++++-- tools/patman/test_checkpatch.py | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +8 -2
@@ -2322,7 +2322,7 @@ sub get_raw_comment { # Checks specific to U-Boot sub u_boot_line { - my ($realfile, $line, $herecurr) = @_; + my ($realfile, $line, $rawline, $herecurr) = @_; # ask for a test if a new uclass ID is added if ($realfile =~ /uclass-id.h/ && $line =~ /^\+/) {
@@ -2353,6 +2353,12 @@ sub u_boot_line { ERROR("DEFINE_CONFIG_CMD", "All commands are managed by Kconfig\n" . $herecurr); } + + # Don't put common.h and dm.h in header files + if ($realfile =~ /\.h$/ && $rawline =~ /^\+#include\s*<(common|dm)\.h>*/) { + ERROR("BARRED_INCLUDE_IN_HDR", + "Avoid including common.h and dm.h in header files\n" . $herecurr); + } } sub process {
@@ -3296,7 +3302,7 @@ sub process { } if ($u_boot) { - u_boot_line($realfile, $line, $herecurr); + u_boot_line($realfile, $line, $rawline, $herecurr); } # check we are in a valid source file C or perl if not then ignore this hunk
tools/patman/test_checkpatch.py +7 -0
@@ -398,6 +398,13 @@ index 0000000..2234c87 pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH') self.checkSingleMessage(pm, 'DEFINE_CONFIG_CMD', 'error') + def testBarredIncludeInHdr(self): + """Test for using a barred include in a header file""" + pm = PatchMaker() + #pm.add_line('include/myfile.h', '#include <common.h>') + pm.add_line('include/myfile.h', '#include <dm.h>') + self.checkSingleMessage(pm, 'BARRED_INCLUDE_IN_HDR', 'error') + if __name__ == "__main__": unittest.main()
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH 31/31 checkpatch: Don't allow common.h and dm.h in headers
Quoted 4 lines · Simon Glass
These headers should not be included in other header files. Add a checkpatch rule and test for this.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200804/d7fa2287/attachment.sig>