[PATCH v3 3/3] dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO

Priyanka Jain
2021-02-11T10:38:58Z

>-----Original Message-----
>From: Igor Opaniuk <igor.opaniuk@foundries.io>
>Sent: Tuesday, February 9, 2021 5:23 PM
>To: u-boot at lists.denx.de
>Cc: ricardo at foundries.io; Michael Scott <mike@foundries.io>;
>jorge at foundries.io; sjg at chromium.org; trini at konsulko.com; Igor Opaniuk
><igor.opaniuk@foundries.io>; Heiko Schocher <hs@denx.de>; Adam Ford
><aford173@gmail.com>; Alison Wang <alison.wang@nxp.com>; Andre Przywara
><andre.przywara@arm.com>; Ashish Kumar <ashish.kumar@nxp.com>; Ashok
>Reddy Soma <ashok.reddy.soma@xilinx.com>; Bhaskar Upadhaya
><bhaskar.upadhaya@nxp.com>; Biwen Li <biwen.li@nxp.com>; Fabio Estevam
><festevam@gmail.com>; Faiz Abbas <faiz_abbas@ti.com>; Feng Li
><feng.li_2@nxp.com>; Frieder Schrempf <frieder.schrempf@kontron.de>; Hans
>de Goede <hdegoede@redhat.com>; Heinrich Schuchardt
><xypron.glpk@gmx.de>; Holger Brunck <holger.brunck@hitachi-
>powergrids.com>; Z.q. Hou <zhiqiang.hou@nxp.com>; Jaehoon Chung
><jh80.chung@samsung.com>; Jagan Teki <jagan@amarulasolutions.com>; Jernej
>Skrabec <jernej.skrabec@siol.net>; Jonas Smedegaard <dr@jones.dk>; Kuldeep
>Singh <kuldeep.singh@nxp.com>; Lokesh Vutla <lokeshvutla@ti.com>; Lukasz
>Majewski <lukma@denx.de>; Madalin Bucur (OSS)
><madalin.bucur@oss.nxp.com>; Manish Tomar <manish.tomar@nxp.com>;
>Marek Szyprowski <m.szyprowski@samsung.com>; Marek Vasut
><marex@denx.de>; Masahiro Yamada <masahiroy@kernel.org>; Meenakshi
>Aggarwal <meenakshi.aggarwal@nxp.com>; Michael Walle <michael@walle.cc>;
>Michal Simek <michal.simek@xilinx.com>; Mingkai Hu <mingkai.hu@nxp.com>;
>dl-uboot-imx <uboot-imx@nxp.com>; Neil Armstrong
><narmstrong@baylibre.com>; Niel Fourie <lusus@denx.de>; Ovidiu Panait
><ovidiu.panait@windriver.com>; Pali Roh?r <pali@kernel.org>; Prabhakar
>Kushwaha <prabhakar.kushwaha@nxp.com>; Pramod Kumar
><pramod.kumar_1@nxp.com>; Priyanka Jain <priyanka.jain@nxp.com>; Priyanka
>Singh <priyanka.singh@nxp.com>; Qiang Zhao <qiang.zhao@nxp.com>; Rai
>Harninder <harninder.rai@nxp.com>; Rajesh Bhagat <rajesh.bhagat@nxp.com>;
>Shengzhou Liu <shengzhou.liu@nxp.com>; Stefan Bosch <stefan_b@posteo.net>;
>Stefan Roese <sr@denx.de>; Stefano Babic <sbabic@denx.de>; Sudhanshu Gupta
><sudhanshu.gupta@nxp.com>; Suman Anna <s-anna@ti.com>; Sumit Garg
><sumit.garg@nxp.com>; Andy Tang <andy.tang@nxp.com>; Udit Agarwal
><udit.agarwal@nxp.com>; Vitaly Andrianov <vitalya@ti.com>; Vladimir Oltean
><olteanv@gmail.com>; Wasim Khan <wasim.khan@nxp.com>; Wolfgang Denk
><wd@denx.de>
>Subject: [PATCH v3 3/3] dm: i2c: use CONFIG_IS_ENABLED macro for
>DM_I2C/DM_I2C_GPIO
>
>From: Igor Opaniuk <igor.opaniuk@foundries.io>
>
>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 <hs@denx.de>
>Reviewed-by: Simon Glass <sjg@chromium.org>
>Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
>
>---
>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>