* [PATCH] mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE
@ 2016-04-20 17:45 Javier Martinez Canillas
2016-04-21 8:29 ` Charles Keepax
2016-04-25 16:19 ` Lee Jones
0 siblings, 2 replies; 3+ messages in thread
From: Javier Martinez Canillas @ 2016-04-20 17:45 UTC (permalink / raw)
To: linux-kernel; +Cc: Javier Martinez Canillas, patches, Lee Jones
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/mfd/dm355evm_msp.c | 8 ++++----
drivers/mfd/wm8400-core.c | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c
index ec4438ed2faf..04c25c4a8ff4 100644
--- a/drivers/mfd/dm355evm_msp.c
+++ b/drivers/mfd/dm355evm_msp.c
@@ -33,25 +33,25 @@
* This driver was tested with firmware revision A4.
*/
-#if defined(CONFIG_INPUT_DM355EVM) || defined(CONFIG_INPUT_DM355EVM_MODULE)
+#if IS_ENABLED(CONFIG_INPUT_DM355EVM)
#define msp_has_keyboard() true
#else
#define msp_has_keyboard() false
#endif
-#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
+#if IS_ENABLED(CONFIG_LEDS_GPIO)
#define msp_has_leds() true
#else
#define msp_has_leds() false
#endif
-#if defined(CONFIG_RTC_DRV_DM355EVM) || defined(CONFIG_RTC_DRV_DM355EVM_MODULE)
+#if IS_ENABLED(CONFIG_RTC_DRV_DM355EVM)
#define msp_has_rtc() true
#else
#define msp_has_rtc() false
#endif
-#if defined(CONFIG_VIDEO_TVP514X) || defined(CONFIG_VIDEO_TVP514X_MODULE)
+#if IS_ENABLED(CONFIG_VIDEO_TVP514X)
#define msp_has_tvp() true
#else
#define msp_has_tvp() false
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 3bd44a45c378..8f9cbc0fb37a 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -156,7 +156,7 @@ void wm8400_reset_codec_reg_cache(struct wm8400 *wm8400)
}
EXPORT_SYMBOL_GPL(wm8400_reset_codec_reg_cache);
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+#if IS_ENABLED(CONFIG_I2C)
static int wm8400_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
@@ -205,7 +205,7 @@ static int __init wm8400_module_init(void)
{
int ret = -ENODEV;
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+#if IS_ENABLED(CONFIG_I2C)
ret = i2c_add_driver(&wm8400_i2c_driver);
if (ret != 0)
pr_err("Failed to register I2C driver: %d\n", ret);
@@ -217,7 +217,7 @@ subsys_initcall(wm8400_module_init);
static void __exit wm8400_module_exit(void)
{
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+#if IS_ENABLED(CONFIG_I2C)
i2c_del_driver(&wm8400_i2c_driver);
#endif
}
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE
2016-04-20 17:45 [PATCH] mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE Javier Martinez Canillas
@ 2016-04-21 8:29 ` Charles Keepax
2016-04-25 16:19 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2016-04-21 8:29 UTC (permalink / raw)
To: Javier Martinez Canillas; +Cc: linux-kernel, patches, Lee Jones
On Wed, Apr 20, 2016 at 01:45:46PM -0400, Javier Martinez Canillas wrote:
> The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
> built-in or as a module, use that macro instead of open coding the same.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>
> ---
8400 parts look fine to me:
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE
2016-04-20 17:45 [PATCH] mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE Javier Martinez Canillas
2016-04-21 8:29 ` Charles Keepax
@ 2016-04-25 16:19 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2016-04-25 16:19 UTC (permalink / raw)
To: Javier Martinez Canillas; +Cc: linux-kernel, patches
On Wed, 20 Apr 2016, Javier Martinez Canillas wrote:
> The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
> built-in or as a module, use that macro instead of open coding the same.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>
> ---
Applied, thanks.
> drivers/mfd/dm355evm_msp.c | 8 ++++----
> drivers/mfd/wm8400-core.c | 6 +++---
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c
> index ec4438ed2faf..04c25c4a8ff4 100644
> --- a/drivers/mfd/dm355evm_msp.c
> +++ b/drivers/mfd/dm355evm_msp.c
> @@ -33,25 +33,25 @@
> * This driver was tested with firmware revision A4.
> */
>
> -#if defined(CONFIG_INPUT_DM355EVM) || defined(CONFIG_INPUT_DM355EVM_MODULE)
> +#if IS_ENABLED(CONFIG_INPUT_DM355EVM)
> #define msp_has_keyboard() true
> #else
> #define msp_has_keyboard() false
> #endif
>
> -#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
> +#if IS_ENABLED(CONFIG_LEDS_GPIO)
> #define msp_has_leds() true
> #else
> #define msp_has_leds() false
> #endif
>
> -#if defined(CONFIG_RTC_DRV_DM355EVM) || defined(CONFIG_RTC_DRV_DM355EVM_MODULE)
> +#if IS_ENABLED(CONFIG_RTC_DRV_DM355EVM)
> #define msp_has_rtc() true
> #else
> #define msp_has_rtc() false
> #endif
>
> -#if defined(CONFIG_VIDEO_TVP514X) || defined(CONFIG_VIDEO_TVP514X_MODULE)
> +#if IS_ENABLED(CONFIG_VIDEO_TVP514X)
> #define msp_has_tvp() true
> #else
> #define msp_has_tvp() false
> diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
> index 3bd44a45c378..8f9cbc0fb37a 100644
> --- a/drivers/mfd/wm8400-core.c
> +++ b/drivers/mfd/wm8400-core.c
> @@ -156,7 +156,7 @@ void wm8400_reset_codec_reg_cache(struct wm8400 *wm8400)
> }
> EXPORT_SYMBOL_GPL(wm8400_reset_codec_reg_cache);
>
> -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
> +#if IS_ENABLED(CONFIG_I2C)
> static int wm8400_i2c_probe(struct i2c_client *i2c,
> const struct i2c_device_id *id)
> {
> @@ -205,7 +205,7 @@ static int __init wm8400_module_init(void)
> {
> int ret = -ENODEV;
>
> -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
> +#if IS_ENABLED(CONFIG_I2C)
> ret = i2c_add_driver(&wm8400_i2c_driver);
> if (ret != 0)
> pr_err("Failed to register I2C driver: %d\n", ret);
> @@ -217,7 +217,7 @@ subsys_initcall(wm8400_module_init);
>
> static void __exit wm8400_module_exit(void)
> {
> -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
> +#if IS_ENABLED(CONFIG_I2C)
> i2c_del_driver(&wm8400_i2c_driver);
> #endif
> }
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-25 16:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20 17:45 [PATCH] mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE Javier Martinez Canillas
2016-04-21 8:29 ` Charles Keepax
2016-04-25 16:19 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).