From 2147a16983d17bcb0438607aa7760494afc27014 Mon Sep 17 00:00:00 2001 From: Igor Opaniuk Date: Tue, 9 Feb 2021 13:52:45 +0200 Subject: dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO Use CONFIG_IS_ENABLED() macro, which provides more convenient way to check $(SPL)DM_I2C/$(SPL)DM_I2C_GPIO configs for both SPL and U-Boot proper. CONFIG_IS_ENABLED(DM_I2C) expands to: - 1 if CONFIG_SPL_BUILD is undefined and CONFIG_DM_I2C is set to 'y', - 1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_DM_I2C is set to 'y', - 0 otherwise. All occurences were replaced automatically using these bash cmds: $ find . -type f -exec sed -i 's/ifndef CONFIG_DM_I2C/if !CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/ifdef CONFIG_DM_I2C/if CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/defined(CONFIG_DM_I2C)/CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/ifndef CONFIG_DM_I2C_GPIO/if !CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + $ find . -type f -exec sed -i 's/ifdef CONFIG_DM_I2C_GPIO/if CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + $ find . -type f -exec sed -i 's/defined(CONFIG_DM_I2C_GPIO)/CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + Reviewed-by: Heiko Schocher Reviewed-by: Simon Glass Signed-off-by: Igor Opaniuk Reviewed-by: Tom Rini Reviewed-by: Priyanka Jain --- arch/arm/include/asm/arch-fsl-layerscape/config.h | 2 +- arch/arm/include/asm/arch-lpc32xx/i2c.h | 2 +- arch/arm/include/asm/mach-imx/mxc_i2c.h | 2 +- arch/arm/include/asm/omap_i2c.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/arch-fsl-layerscape/config.h b/arch/arm/include/asm/arch-fsl-layerscape/config.h index a9bd8b2..da7ca05 100644 --- a/arch/arm/include/asm/arch-fsl-layerscape/config.h +++ b/arch/arm/include/asm/arch-fsl-layerscape/config.h @@ -183,7 +183,7 @@ #elif defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LX2162A) #define TZPC_BASE 0x02200000 #define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804) -#if !defined(CONFIG_DM_I2C) +#if !CONFIG_IS_ENABLED(DM_I2C) #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_EARLY_INIT #endif diff --git a/arch/arm/include/asm/arch-lpc32xx/i2c.h b/arch/arm/include/asm/arch-lpc32xx/i2c.h index f39b140..3918178 100644 --- a/arch/arm/include/asm/arch-lpc32xx/i2c.h +++ b/arch/arm/include/asm/arch-lpc32xx/i2c.h @@ -22,7 +22,7 @@ struct lpc32xx_i2c_base { u32 stxfl; }; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED(DM_I2C) enum { I2C_0, I2C_1, I2C_2, }; diff --git a/arch/arm/include/asm/mach-imx/mxc_i2c.h b/arch/arm/include/asm/mach-imx/mxc_i2c.h index c016aa7..e8b330f 100644 --- a/arch/arm/include/asm/mach-imx/mxc_i2c.h +++ b/arch/arm/include/asm/mach-imx/mxc_i2c.h @@ -53,7 +53,7 @@ struct mxc_i2c_bus { #if CONFIG_IS_ENABLED(CLK) struct clk per_clk; #endif -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED(DM_I2C) int (*idle_bus_fn)(void *p); void *idle_bus_data; #else diff --git a/arch/arm/include/asm/omap_i2c.h b/arch/arm/include/asm/omap_i2c.h index ec7a145..9f0f272 100644 --- a/arch/arm/include/asm/omap_i2c.h +++ b/arch/arm/include/asm/omap_i2c.h @@ -3,7 +3,7 @@ #ifndef _OMAP_I2C_H #define _OMAP_I2C_H -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED(DM_I2C) /* Information about a GPIO bank */ struct omap_i2c_plat { -- cgit v1.1