Commit fcebddb9 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Tony Lindgren

ARM: OMAP1: use IS_ENABLED() instead of checking for built-in or 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.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.
Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 29b4817d
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "board-h2.h" #include "board-h2.h"
#include "mmc.h" #include "mmc.h"
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) #if IS_ENABLED(CONFIG_MMC_OMAP)
static int mmc_set_power(struct device *dev, int slot, int power_on, static int mmc_set_power(struct device *dev, int slot, int power_on,
int vdd) int vdd)
......
...@@ -349,7 +349,7 @@ static struct omap_usb_config h2_usb_config __initdata = { ...@@ -349,7 +349,7 @@ static struct omap_usb_config h2_usb_config __initdata = {
#if IS_ENABLED(CONFIG_USB_OMAP) #if IS_ENABLED(CONFIG_USB_OMAP)
.hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */ .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */
/* .hmc_mode = 21,*/ /* 0:host(off) 1:dev(loopback) 2:host(loopback) */ /* .hmc_mode = 21,*/ /* 0:host(off) 1:dev(loopback) 2:host(loopback) */
#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) #elif IS_ENABLED(CONFIG_USB_OHCI_HCD)
/* needs OTG cable, or NONSTANDARD (B-to-MiniB) */ /* needs OTG cable, or NONSTANDARD (B-to-MiniB) */
.hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */ .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */
#endif #endif
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "board-h3.h" #include "board-h3.h"
#include "mmc.h" #include "mmc.h"
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) #if IS_ENABLED(CONFIG_MMC_OMAP)
static int mmc_set_power(struct device *dev, int slot, int power_on, static int mmc_set_power(struct device *dev, int slot, int power_on,
int vdd) int vdd)
......
...@@ -368,7 +368,7 @@ static struct omap_usb_config h3_usb_config __initdata = { ...@@ -368,7 +368,7 @@ static struct omap_usb_config h3_usb_config __initdata = {
#if IS_ENABLED(CONFIG_USB_OMAP) #if IS_ENABLED(CONFIG_USB_OMAP)
.hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */ .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */
#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) #elif IS_ENABLED(CONFIG_USB_OHCI_HCD)
/* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */ /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */
.hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */ .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */
#endif #endif
......
...@@ -401,7 +401,7 @@ static struct platform_device lcd_device = { ...@@ -401,7 +401,7 @@ static struct platform_device lcd_device = {
}; };
/* MMC Card */ /* MMC Card */
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) #if IS_ENABLED(CONFIG_MMC_OMAP)
static struct omap_mmc_platform_data htc_mmc1_data = { static struct omap_mmc_platform_data htc_mmc1_data = {
.nr_slots = 1, .nr_slots = 1,
.switch_slot = NULL, .switch_slot = NULL,
...@@ -586,7 +586,7 @@ static void __init htcherald_init(void) ...@@ -586,7 +586,7 @@ static void __init htcherald_init(void)
omap_register_i2c_bus(1, 100, NULL, 0); omap_register_i2c_bus(1, 100, NULL, 0);
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) #if IS_ENABLED(CONFIG_MMC_OMAP)
htc_mmc_data[0] = &htc_mmc1_data; htc_mmc_data[0] = &htc_mmc1_data;
omap1_init_mmc(htc_mmc_data, 1); omap1_init_mmc(htc_mmc_data, 1);
#endif #endif
......
...@@ -315,7 +315,7 @@ static struct omap_usb_config h2_usb_config __initdata = { ...@@ -315,7 +315,7 @@ static struct omap_usb_config h2_usb_config __initdata = {
#if IS_ENABLED(CONFIG_USB_OMAP) #if IS_ENABLED(CONFIG_USB_OMAP)
.hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */ .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */
/* .hmc_mode = 21,*/ /* 0:host(off) 1:dev(loopback) 2:host(loopback) */ /* .hmc_mode = 21,*/ /* 0:host(off) 1:dev(loopback) 2:host(loopback) */
#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) #elif IS_ENABLED(CONFIG_USB_OHCI_HCD)
/* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */ /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */
.hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */ .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */
#endif #endif
...@@ -328,7 +328,7 @@ static struct omap_lcd_config innovator1610_lcd_config __initdata = { ...@@ -328,7 +328,7 @@ static struct omap_lcd_config innovator1610_lcd_config __initdata = {
}; };
#endif #endif
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) #if IS_ENABLED(CONFIG_MMC_OMAP)
static int mmc_set_power(struct device *dev, int slot, int power_on, static int mmc_set_power(struct device *dev, int slot, int power_on,
int vdd) int vdd)
......
...@@ -159,7 +159,7 @@ static struct omap_usb_config nokia770_usb_config __initdata = { ...@@ -159,7 +159,7 @@ static struct omap_usb_config nokia770_usb_config __initdata = {
.extcon = "tahvo-usb", .extcon = "tahvo-usb",
}; };
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) #if IS_ENABLED(CONFIG_MMC_OMAP)
#define NOKIA770_GPIO_MMC_POWER 41 #define NOKIA770_GPIO_MMC_POWER 41
#define NOKIA770_GPIO_MMC_SWITCH 23 #define NOKIA770_GPIO_MMC_SWITCH 23
...@@ -216,7 +216,7 @@ static inline void nokia770_mmc_init(void) ...@@ -216,7 +216,7 @@ static inline void nokia770_mmc_init(void)
} }
#endif #endif
#if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE) #if IS_ENABLED(CONFIG_I2C_CBUS_GPIO)
static struct i2c_cbus_platform_data nokia770_cbus_data = { static struct i2c_cbus_platform_data nokia770_cbus_data = {
.clk_gpio = OMAP_MPUIO(9), .clk_gpio = OMAP_MPUIO(9),
.dat_gpio = OMAP_MPUIO(10), .dat_gpio = OMAP_MPUIO(10),
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "mmc.h" #include "mmc.h"
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) #if IS_ENABLED(CONFIG_MMC_OMAP)
static int mmc_set_power(struct device *dev, int slot, int power_on, static int mmc_set_power(struct device *dev, int slot, int power_on,
int vdd) int vdd)
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "mmc.h" #include "mmc.h"
#include "sram.h" #include "sram.h"
#if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE) #if IS_ENABLED(CONFIG_RTC_DRV_OMAP)
#define OMAP_RTC_BASE 0xfffb4800 #define OMAP_RTC_BASE 0xfffb4800
...@@ -72,7 +72,7 @@ static inline void omap_init_mbox(void) { } ...@@ -72,7 +72,7 @@ static inline void omap_init_mbox(void) { }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) #if IS_ENABLED(CONFIG_MMC_OMAP)
static inline void omap1_mmc_mux(struct omap_mmc_platform_data *mmc_controller, static inline void omap1_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
int controller_nr) int controller_nr)
...@@ -230,7 +230,7 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, ...@@ -230,7 +230,7 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* OMAP7xx SPI support */ /* OMAP7xx SPI support */
#if defined(CONFIG_SPI_OMAP_100K) || defined(CONFIG_SPI_OMAP_100K_MODULE) #if IS_ENABLED(CONFIG_SPI_OMAP_100K)
struct platform_device omap_spi1 = { struct platform_device omap_spi1 = {
.name = "omap1_spi100k", .name = "omap1_spi100k",
...@@ -312,7 +312,7 @@ static inline void omap_init_sti(void) {} ...@@ -312,7 +312,7 @@ static inline void omap_init_sti(void) {}
* mcbsp1..3 = 5..7 * mcbsp1..3 = 5..7
*/ */
#if defined(CONFIG_SPI_OMAP_UWIRE) || defined(CONFIG_SPI_OMAP_UWIRE_MODULE) #if IS_ENABLED(CONFIG_SPI_OMAP_UWIRE)
#define OMAP_UWIRE_BASE 0xfffb3000 #define OMAP_UWIRE_BASE 0xfffb3000
...@@ -418,7 +418,7 @@ static int __init omap1_init_devices(void) ...@@ -418,7 +418,7 @@ static int __init omap1_init_devices(void)
} }
arch_initcall(omap1_init_devices); arch_initcall(omap1_init_devices);
#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE) #if IS_ENABLED(CONFIG_OMAP_WATCHDOG)
static struct resource wdt_resources[] = { static struct resource wdt_resources[] = {
{ {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) #if IS_ENABLED(CONFIG_FB_OMAP)
static bool omapfb_lcd_configured; static bool omapfb_lcd_configured;
static struct omapfb_platform_data omapfb_config; static struct omapfb_platform_data omapfb_config;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
void omap_otg_init(struct omap_usb_config *config); void omap_otg_init(struct omap_usb_config *config);
#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE) #if IS_ENABLED(CONFIG_USB)
void omap1_usb_init(struct omap_usb_config *pdata); void omap1_usb_init(struct omap_usb_config *pdata);
#else #else
static inline void omap1_usb_init(struct omap_usb_config *pdata) static inline void omap1_usb_init(struct omap_usb_config *pdata)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#define OMAP1_MMC1_BASE 0xfffb7800 #define OMAP1_MMC1_BASE 0xfffb7800
#define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */ #define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) #if IS_ENABLED(CONFIG_MMC_OMAP)
void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
int nr_controllers); int nr_controllers);
#else #else
......
...@@ -136,7 +136,7 @@ omap_otg_init(struct omap_usb_config *config) ...@@ -136,7 +136,7 @@ omap_otg_init(struct omap_usb_config *config)
} }
#endif #endif
#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) #if IS_ENABLED(CONFIG_USB_OHCI_HCD)
if (config->otg || config->register_host) { if (config->otg || config->register_host) {
struct platform_device *ohci_device = config->ohci_device; struct platform_device *ohci_device = config->ohci_device;
int status; int status;
...@@ -221,7 +221,7 @@ static inline void udc_device_init(struct omap_usb_config *pdata) ...@@ -221,7 +221,7 @@ static inline void udc_device_init(struct omap_usb_config *pdata)
#endif #endif
#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) #if IS_ENABLED(CONFIG_USB_OHCI_HCD)
/* The dmamask must be set for OHCI to work */ /* The dmamask must be set for OHCI to work */
static u64 ohci_dmamask = ~(u32)0; static u64 ohci_dmamask = ~(u32)0;
...@@ -612,7 +612,7 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config) ...@@ -612,7 +612,7 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config)
} }
#endif #endif
#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) #if IS_ENABLED(CONFIG_USB_OHCI_HCD)
if (config->register_host) { if (config->register_host) {
int status; int status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment