From 0f0f4e5feb15a90404aaa78a45c0b9fec9a8efb6 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:42 -0400 Subject: [PATCH 01/19] clk: sifive: Include device_compat.h Necessary for dev_xxx. Signed-off-by: Sean Anderson --- drivers/clk/sifive/fu540-prci.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c index c5148e9a37..1b4d81d4f0 100644 --- a/drivers/clk/sifive/fu540-prci.c +++ b/drivers/clk/sifive/fu540-prci.c @@ -29,23 +29,23 @@ */ #include -#include -#include #include #include #include #include -#include -#include #include +#include #include -#include -#include - -#include -#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include /* * EXPECTED_CLK_PARENT_COUNT: how many parent clocks this driver expects: From 4d55155f6c11cf1ff3c6ba28af1e4567325623d1 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:43 -0400 Subject: [PATCH 02/19] dm: syscon: Set LOG_CATEGORY We call log_debug, but do not have a category set. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- drivers/core/syscon-uclass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c index 5be1d527a0..509b09845a 100644 --- a/drivers/core/syscon-uclass.c +++ b/drivers/core/syscon-uclass.c @@ -4,6 +4,8 @@ * Written by Simon Glass */ +#define LOG_CATEGORY UCLASS_SYSCON + #include #include #include From 66e7348fe7cbd40091dad017363f0d788ea69739 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:44 -0400 Subject: [PATCH 03/19] firmware: scmi: Include device_compat.h This header is necessary for the dev_xxx macros. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- drivers/firmware/scmi/mailbox_agent.c | 1 + drivers/firmware/scmi/scmi_agent-uclass.c | 1 + drivers/firmware/scmi/smt.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/firmware/scmi/mailbox_agent.c b/drivers/firmware/scmi/mailbox_agent.c index 7d9fb3622e..a85cff1097 100644 --- a/drivers/firmware/scmi/mailbox_agent.c +++ b/drivers/firmware/scmi/mailbox_agent.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c index 77160b1999..7dc533149b 100644 --- a/drivers/firmware/scmi/scmi_agent-uclass.c +++ b/drivers/firmware/scmi/scmi_agent-uclass.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/drivers/firmware/scmi/smt.c b/drivers/firmware/scmi/smt.c index ce8fe49939..d25478796a 100644 --- a/drivers/firmware/scmi/smt.c +++ b/drivers/firmware/scmi/smt.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include From baed179d2f846a86297203545059bcd209207ca1 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:45 -0400 Subject: [PATCH 04/19] mtd: mxs_nand: Fix not calling dev_xxx with a device This includes device_compat.h, and fixes several calls to dev_xxx. Signed-off-by: Sean Anderson --- drivers/mtd/nand/raw/mxs_nand.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/mtd/nand/raw/mxs_nand.c b/drivers/mtd/nand/raw/mxs_nand.c index a7852a841c..e6bbfac4d6 100644 --- a/drivers/mtd/nand/raw/mxs_nand.c +++ b/drivers/mtd/nand/raw/mxs_nand.c @@ -16,19 +16,20 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #define MXS_NAND_DMA_DESCRIPTOR_COUNT 4 @@ -115,13 +116,14 @@ static uint32_t mxs_nand_aux_status_offset(void) return (MXS_NAND_METADATA_SIZE + 0x3) & ~0x3; } -static inline bool mxs_nand_bbm_in_data_chunk(struct bch_geometry *geo, struct mtd_info *mtd, - unsigned int *chunk_num) +static inline bool mxs_nand_bbm_in_data_chunk(struct bch_geometry *geo, + struct mtd_info *mtd, + unsigned int *chunk_num) { unsigned int i, j; if (geo->ecc_chunk0_size != geo->ecc_chunkn_size) { - dev_err(this->dev, "The size of chunk0 must equal to chunkn\n"); + dev_err(mtd->dev, "The size of chunk0 must equal to chunkn\n"); return false; } @@ -135,7 +137,7 @@ static inline bool mxs_nand_bbm_in_data_chunk(struct bch_geometry *geo, struct m if (j < geo->ecc_chunkn_size * 8) { *chunk_num = i + 1; - dev_dbg(this->dev, "Set ecc to %d and bbm in chunk %d\n", + dev_dbg(mtd->dev, "Set ecc to %d and bbm in chunk %d\n", geo->ecc_strength, *chunk_num); return true; } @@ -1118,7 +1120,7 @@ static int mxs_nand_set_geometry(struct mtd_info *mtd, struct bch_geometry *geo) if ((!(chip->ecc_strength_ds > 0 && chip->ecc_step_ds > 0) && mtd->oobsize < 1024) || nand_info->legacy_bch_geometry) { - dev_warn(this->dev, "use legacy bch geometry\n"); + dev_warn(mtd->dev, "use legacy bch geometry\n"); return mxs_nand_legacy_calc_ecc_layout(geo, mtd); } From d878ef736d8f1c3f4bd8a1899de631cae9405b3a Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:46 -0400 Subject: [PATCH 05/19] net: ldpaa_eth: Include device_compat.h Necessary for dev_xxx. Signed-off-by: Sean Anderson --- drivers/net/ldpaa_eth/ldpaa_eth.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c index 67da549fdb..42eaf49d71 100644 --- a/drivers/net/ldpaa_eth/ldpaa_eth.c +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c @@ -6,20 +6,20 @@ #include #include +#include +#include +#include +#include #include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include #include #include -#include #include - -#include #include "ldpaa_eth.h" #ifdef CONFIG_PHYLIB From bdc1fdf6fc5cbcffa669e1a374fb17685e58eeba Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:47 -0400 Subject: [PATCH 06/19] phy: Include device_compat.h Necessary for dev_xxx. Signed-off-by: Sean Anderson --- drivers/phy/phy-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-uclass.c b/drivers/phy/phy-uclass.c index f344e94b43..ef03e3a502 100644 --- a/drivers/phy/phy-uclass.c +++ b/drivers/phy/phy-uclass.c @@ -6,9 +6,9 @@ #include #include +#include #include #include -#include static inline struct phy_ops *phy_dev_ops(struct udevice *dev) { From 8d4c5966440539c19c419c4997ccb40d5f1a4ffc Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:48 -0400 Subject: [PATCH 07/19] ram: imxrt: Include device_compat.h Necessary for dev_xxx. Signed-off-by: Sean Anderson --- drivers/ram/imxrt_sdram.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ram/imxrt_sdram.c b/drivers/ram/imxrt_sdram.c index 765a2141d1..b6ee02d227 100644 --- a/drivers/ram/imxrt_sdram.c +++ b/drivers/ram/imxrt_sdram.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include From 06aaca51588ee161a144982368dd10bc86f3f336 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:49 -0400 Subject: [PATCH 08/19] spi: nxp_fspi: Include device_compat.h Necessary for dev_xxx. Signed-off-by: Sean Anderson --- drivers/spi/nxp_fspi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/nxp_fspi.c b/drivers/spi/nxp_fspi.c index ebd94925e9..9661e9e10d 100644 --- a/drivers/spi/nxp_fspi.c +++ b/drivers/spi/nxp_fspi.c @@ -34,12 +34,13 @@ */ #include -#include +#include +#include +#include #include #include #include -#include -#include +#include #include #include #include From d13da03f3b365cb48222692768f9c047fce1d569 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:50 -0400 Subject: [PATCH 09/19] spi: fsl_qspi: Include device_compat.h Necessary for dev_xxx. Signed-off-by: Sean Anderson --- drivers/spi/fsl_qspi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index eec968e5ec..128f95877f 100644 --- a/drivers/spi/fsl_qspi.c +++ b/drivers/spi/fsl_qspi.c @@ -24,19 +24,20 @@ */ #include +#include +#include #include -#include +#include +#include #include #include #include #include #include -#include #include #include #include -#include -#include +#include DECLARE_GLOBAL_DATA_PTR; From 7399897b6c0ac5346444347ba516528b991e720f Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:51 -0400 Subject: [PATCH 10/19] tee: optee: Include device_compat.h Necessary for dev_xxx. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- drivers/tee/optee/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 5260dab3ac..66ade37cd4 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include From a5d4f861247fe3601162b397b2f7cd29c9c7d749 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:52 -0400 Subject: [PATCH 11/19] timer: Include device_compat.h Necessary for dev_xxx. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- drivers/timer/timer-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index e9802c8b43..f8a092b8cb 100644 --- a/drivers/timer/timer-uclass.c +++ b/drivers/timer/timer-uclass.c @@ -4,14 +4,15 @@ */ #include +#include #include #include -#include #include +#include #include #include -#include #include +#include #include #include From f526aee31fd1977678588bb089897c80a5cddc85 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:53 -0400 Subject: [PATCH 12/19] usb: xhci: Include device_compat.h This header is necessary for the dev_xxx macros. Signed-off-by: Sean Anderson --- drivers/usb/host/xhci-mtk.c | 5 +++-- drivers/usb/host/xhci.c | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index f3f181dae0..f62e232d21 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -7,15 +7,16 @@ #include #include #include +#include #include #include #include +#include #include +#include #include #include -#include #include -#include /* IPPC (IP Port Control) registers */ #define IPPC_IP_PW_CTRL0 0x00 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 3547a9bad1..7080f8fabe 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -22,11 +22,13 @@ #include #include #include +#include #include -#include -#include #include +#include +#include #include +#include #include #include #include @@ -34,7 +36,6 @@ #include #include #include -#include #ifndef CONFIG_USB_MAX_CONTROLLER_COUNT #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 From e010524b5da4667a83f713e5a3db99726ad40f63 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:54 -0400 Subject: [PATCH 13/19] usb: musb-new: Include device_compat.h This was included, but was ifdef'd out. We also need dm.h for struct udevice. Signed-off-by: Sean Anderson --- drivers/usb/musb-new/musb_core.c | 2 ++ drivers/usb/musb-new/musb_dsps.c | 2 ++ drivers/usb/musb-new/musb_gadget.c | 2 ++ drivers/usb/musb-new/musb_gadget_ep0.c | 4 +++- drivers/usb/musb-new/musb_host.c | 2 ++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb-new/musb_core.c b/drivers/usb/musb-new/musb_core.c index 961de99795..22811a5efb 100644 --- a/drivers/usb/musb-new/musb_core.c +++ b/drivers/usb/musb-new/musb_core.c @@ -80,6 +80,8 @@ #include #else #include +#include +#include #include #include #include diff --git a/drivers/usb/musb-new/musb_dsps.c b/drivers/usb/musb-new/musb_dsps.c index eb590885bc..236bab3dc1 100644 --- a/drivers/usb/musb-new/musb_dsps.c +++ b/drivers/usb/musb-new/musb_dsps.c @@ -32,6 +32,8 @@ #include #else #include +#include +#include #include #include "linux-compat.h" #endif diff --git a/drivers/usb/musb-new/musb_gadget.c b/drivers/usb/musb-new/musb_gadget.c index 8ba98d8c0e..5b149dac6d 100644 --- a/drivers/usb/musb-new/musb_gadget.c +++ b/drivers/usb/musb-new/musb_gadget.c @@ -23,6 +23,8 @@ #include #else #include +#include +#include #include #include #include "linux-compat.h" diff --git a/drivers/usb/musb-new/musb_gadget_ep0.c b/drivers/usb/musb-new/musb_gadget_ep0.c index 93f43ba471..cbd92fca6b 100644 --- a/drivers/usb/musb-new/musb_gadget_ep0.c +++ b/drivers/usb/musb-new/musb_gadget_ep0.c @@ -19,8 +19,10 @@ #include #else #include -#include "linux-compat.h" +#include +#include #include +#include "linux-compat.h" #endif #include "musb_core.h" diff --git a/drivers/usb/musb-new/musb_host.c b/drivers/usb/musb-new/musb_host.c index 5fa013659c..acb2d40f3b 100644 --- a/drivers/usb/musb-new/musb_host.c +++ b/drivers/usb/musb-new/musb_host.c @@ -22,6 +22,8 @@ #include #else #include +#include +#include #include #include #include "linux-compat.h" From 0b4826a9a8bb668782823ecc3adade4f8678f015 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:55 -0400 Subject: [PATCH 14/19] usb: musb-new: mt85xx: Fix not calling dev_err with a device This driver doesn't use DM (in the correct places), so we use a device and not a udevice. We also need to include device_compat.h Signed-off-by: Sean Anderson --- drivers/usb/musb-new/mt85xx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/musb-new/mt85xx.c b/drivers/usb/musb-new/mt85xx.c index c281c38a28..8f0561eeba 100644 --- a/drivers/usb/musb-new/mt85xx.c +++ b/drivers/usb/musb-new/mt85xx.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -244,17 +245,17 @@ static int mtk_musb_init(struct musb *musb) ret = clk_enable(&glue->usbpllclk); if (ret) { - dev_err(dev, "failed to enable usbpll clock\n"); + dev_err(musb->controller, "failed to enable usbpll clock\n"); return ret; } ret = clk_enable(&glue->usbmcuclk); if (ret) { - dev_err(dev, "failed to enable usbmcu clock\n"); + dev_err(musb->controller, "failed to enable usbmcu clock\n"); return ret; } ret = clk_enable(&glue->usbclk); if (ret) { - dev_err(dev, "failed to enable usb clock\n"); + dev_err(musb->controller, "failed to enable usb clock\n"); return ret; } From e1f306c07cc775721bccba3ae412521b12367002 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 15 Oct 2020 21:44:15 -0400 Subject: [PATCH 15/19] arm: fsl-layerscape: Include device_compat.h in soc.c Necessary for dev_xxx. Signed-off-by: Tom Rini --- arch/arm/cpu/armv8/fsl-layerscape/soc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c index ba42c185c4..96b2775f3f 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c @@ -37,6 +37,7 @@ #include #endif #include +#include #include #if defined(CONFIG_TFABOOT) || defined(CONFIG_GIC_V3_ITS) DECLARE_GLOBAL_DATA_PTR; From 689639798a8b90d367e6fedc07a27e87b9b84bb4 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 15 Oct 2020 21:44:43 -0400 Subject: [PATCH 16/19] clk: at91: Include device_compat.h in compat.c Necessary for dev_xxx. Signed-off-by: Tom Rini --- drivers/clk/at91/compat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/at91/compat.c b/drivers/clk/at91/compat.c index 8cf6254046..9563285674 100644 --- a/drivers/clk/at91/compat.c +++ b/drivers/clk/at91/compat.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include From 2e8446318861ec7df013180975ce50cdb4604d40 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 16 Oct 2020 08:41:37 -0400 Subject: [PATCH 17/19] usb: dwc3: Include device_compat.h in dwc3-octeon-glue.c Necessary for dev_xxx. Signed-off-by: Tom Rini --- drivers/usb/host/dwc3-octeon-glue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/dwc3-octeon-glue.c b/drivers/usb/host/dwc3-octeon-glue.c index 39b3185616..c3cac9c5ab 100644 --- a/drivers/usb/host/dwc3-octeon-glue.c +++ b/drivers/usb/host/dwc3-octeon-glue.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include From 69dae8902b16c3d6f3a6b3932bca95b6b913f8ee Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:56 -0400 Subject: [PATCH 18/19] linux/compat.h: Remove redefinition of dev_xxx macros All users of these functions now include dm/device_compat.h directly. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- include/linux/compat.h | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/include/linux/compat.h b/include/linux/compat.h index d129780312..38549baa25 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -24,34 +24,6 @@ struct p_current{ extern struct p_current *current; -/* avoid conflict with */ -#ifdef dev_dbg -#undef dev_dbg -#endif -#ifdef dev_vdbg -#undef dev_vdbg -#endif -#ifdef dev_info -#undef dev_info -#endif -#ifdef dev_err -#undef dev_err -#endif -#ifdef dev_warn -#undef dev_warn -#endif - -#define dev_dbg(dev, fmt, args...) \ - debug(fmt, ##args) -#define dev_vdbg(dev, fmt, args...) \ - debug(fmt, ##args) -#define dev_info(dev, fmt, args...) \ - printf(fmt, ##args) -#define dev_err(dev, fmt, args...) \ - printf(fmt, ##args) -#define dev_warn(dev, fmt, args...) \ - printf(fmt, ##args) - #define GFP_ATOMIC ((gfp_t) 0) #define GFP_KERNEL ((gfp_t) 0) #define GFP_NOFS ((gfp_t) 0) From 4a1989c0bc77565493fd142ce224d5d0c88deda9 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 4 Oct 2020 21:39:57 -0400 Subject: [PATCH 19/19] dm: Don't undefine dev_xxx macros Now that linux/compat.h does not define these macros, we do not need to undefine them. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- include/dm/device_compat.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/include/dm/device_compat.h b/include/dm/device_compat.h index 8f26053b45..82d7a7d492 100644 --- a/include/dm/device_compat.h +++ b/include/dm/device_compat.h @@ -15,26 +15,6 @@ #include #include -/* - * REVISIT: - * remove the following after resolving conflicts with - */ -#ifdef dev_dbg -#undef dev_dbg -#endif -#ifdef dev_vdbg -#undef dev_vdbg -#endif -#ifdef dev_info -#undef dev_info -#endif -#ifdef dev_err -#undef dev_err -#endif -#ifdef dev_warn -#undef dev_warn -#endif - /* * Define a new identifier which can be tested on by C code. A similar * definition is made for DEBUG in .