Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE

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>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Javier Martinez Canillas and committed by
Lee Jones
5eb519f3 d6441dc5

+7 -7
+4 -4
drivers/mfd/dm355evm_msp.c
··· 33 33 * This driver was tested with firmware revision A4. 34 34 */ 35 35 36 - #if defined(CONFIG_INPUT_DM355EVM) || defined(CONFIG_INPUT_DM355EVM_MODULE) 36 + #if IS_ENABLED(CONFIG_INPUT_DM355EVM) 37 37 #define msp_has_keyboard() true 38 38 #else 39 39 #define msp_has_keyboard() false 40 40 #endif 41 41 42 - #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 42 + #if IS_ENABLED(CONFIG_LEDS_GPIO) 43 43 #define msp_has_leds() true 44 44 #else 45 45 #define msp_has_leds() false 46 46 #endif 47 47 48 - #if defined(CONFIG_RTC_DRV_DM355EVM) || defined(CONFIG_RTC_DRV_DM355EVM_MODULE) 48 + #if IS_ENABLED(CONFIG_RTC_DRV_DM355EVM) 49 49 #define msp_has_rtc() true 50 50 #else 51 51 #define msp_has_rtc() false 52 52 #endif 53 53 54 - #if defined(CONFIG_VIDEO_TVP514X) || defined(CONFIG_VIDEO_TVP514X_MODULE) 54 + #if IS_ENABLED(CONFIG_VIDEO_TVP514X) 55 55 #define msp_has_tvp() true 56 56 #else 57 57 #define msp_has_tvp() false
+3 -3
drivers/mfd/wm8400-core.c
··· 126 126 } 127 127 EXPORT_SYMBOL_GPL(wm8400_reset_codec_reg_cache); 128 128 129 - #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 129 + #if IS_ENABLED(CONFIG_I2C) 130 130 static int wm8400_i2c_probe(struct i2c_client *i2c, 131 131 const struct i2c_device_id *id) 132 132 { ··· 165 165 { 166 166 int ret = -ENODEV; 167 167 168 - #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 168 + #if IS_ENABLED(CONFIG_I2C) 169 169 ret = i2c_add_driver(&wm8400_i2c_driver); 170 170 if (ret != 0) 171 171 pr_err("Failed to register I2C driver: %d\n", ret); ··· 177 177 178 178 static void __exit wm8400_module_exit(void) 179 179 { 180 - #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 180 + #if IS_ENABLED(CONFIG_I2C) 181 181 i2c_del_driver(&wm8400_i2c_driver); 182 182 #endif 183 183 }