diff options
author | Steven Miao <realmz6@gmail.com> | 2014-04-11 22:07:27 +0400 |
---|---|---|
committer | Steven Miao <realmz6@gmail.com> | 2014-04-12 04:48:01 +0400 |
commit | c4a2c58d20953ff1080f50f705cdd952f6d301b2 (patch) | |
tree | 9e604fad91d728839cbbea1549248339729a1829 /arch/blackfin/mach-bf533/boards/stamp.c | |
parent | f8ef77d9389f9b52fe80de4f1b236af3391420b8 (diff) | |
download | linux-c4a2c58d20953ff1080f50f705cdd952f6d301b2.tar.xz |
blackfin: cleanup board files
using IS_ENABLED() macro instead of defined(CONFIG_XXX) || defined(CONFIG_XXX_MODULE)
Signed-off-by: Steven Miao <realmz6@gmail.com>
Diffstat (limited to 'arch/blackfin/mach-bf533/boards/stamp.c')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 118 |
1 files changed, 53 insertions, 65 deletions
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c index 4da70c47cc05..d0989290f54c 100644 --- a/arch/blackfin/mach-bf533/boards/stamp.c +++ b/arch/blackfin/mach-bf533/boards/stamp.c @@ -14,7 +14,7 @@ #include <linux/spi/spi.h> #include <linux/spi/flash.h> #include <linux/spi/mmc_spi.h> -#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) +#if IS_ENABLED(CONFIG_USB_ISP1362_HCD) #include <linux/usb/isp1362.h> #endif #include <linux/irq.h> @@ -30,7 +30,7 @@ */ const char bfin_board_name[] = "ADI BF533-STAMP"; -#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) +#if IS_ENABLED(CONFIG_RTC_DRV_BFIN) static struct platform_device rtc_device = { .name = "rtc-bfin", .id = -1, @@ -40,7 +40,7 @@ static struct platform_device rtc_device = { /* * Driver needs to know address, irq and flag pin. */ -#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#if IS_ENABLED(CONFIG_SMC91X) #include <linux/smc91x.h> static struct smc91x_platdata smc91x_info = { @@ -73,7 +73,7 @@ static struct platform_device smc91x_device = { }; #endif -#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) +#if IS_ENABLED(CONFIG_USB_NET2272) static struct resource net2272_bfin_resources[] = { { .start = 0x20300000, @@ -97,7 +97,7 @@ static struct platform_device net2272_bfin_device = { }; #endif -#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) +#if IS_ENABLED(CONFIG_MTD_BFIN_ASYNC) static struct mtd_partition stamp_partitions[] = { { .name = "bootloader(nor)", @@ -147,7 +147,7 @@ static struct platform_device stamp_flash_device = { }; #endif -#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) +#if IS_ENABLED(CONFIG_MTD_M25P80) static struct mtd_partition bfin_spi_flash_partitions[] = { { .name = "bootloader(spi)", @@ -178,7 +178,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { }; #endif -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) +#if IS_ENABLED(CONFIG_MMC_SPI) #define MMC_SPI_CARD_DETECT_INT IRQ_PF5 static int bfin_mmc_spi_init(struct device *dev, irqreturn_t (*detect_int)(int, void *), void *data) @@ -206,7 +206,7 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = { #endif static struct spi_board_info bfin_spi_board_info[] __initdata = { -#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) +#if IS_ENABLED(CONFIG_MTD_M25P80) { /* the modalias must be the same as spi device driver name */ .modalias = "m25p80", /* Name of spi_driver for this device */ @@ -219,8 +219,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { }, #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ - defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836) { .modalias = "ad1836", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ @@ -231,7 +230,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { }, #endif -#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) +#if IS_ENABLED(CONFIG_SPI_SPIDEV) { .modalias = "spidev", .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ @@ -239,7 +238,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { .chip_select = 1, }, #endif -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) +#if IS_ENABLED(CONFIG_MMC_SPI) { .modalias = "mmc_spi", .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ @@ -252,7 +251,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { #endif }; -#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) +#if IS_ENABLED(CONFIG_SPI_BFIN5XX) /* SPI (0) */ static struct resource bfin_spi0_resource[] = { [0] = { @@ -290,7 +289,7 @@ static struct platform_device bfin_spi0_device = { }; #endif /* spi master and devices */ -#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) +#if IS_ENABLED(CONFIG_SERIAL_BFIN) #ifdef CONFIG_SERIAL_BFIN_UART0 static struct resource bfin_uart0_resources[] = { { @@ -341,7 +340,7 @@ static struct platform_device bfin_uart0_device = { #endif #endif -#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) +#if IS_ENABLED(CONFIG_BFIN_SIR) #ifdef CONFIG_BFIN_SIR0 static struct resource bfin_sir0_resources[] = { { @@ -370,8 +369,7 @@ static struct platform_device bfin_sir0_device = { #endif #endif -#if defined(CONFIG_SERIAL_BFIN_SPORT) || \ - defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) +#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT) #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART static struct resource bfin_sport0_uart_resources[] = { { @@ -442,7 +440,7 @@ static struct platform_device bfin_sport1_uart_device = { #endif #endif -#if defined(CONFIG_BFIN_SPORT) || defined(CONFIG_BFIN_SPORT_MODULE) +#if IS_ENABLED(CONFIG_BFIN_SPORT) static struct resource bfin_sport0_resources[] = { { .start = SPORT0_TCR1, @@ -486,7 +484,7 @@ static struct platform_device bfin_sport0_device = { }; #endif -#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) +#if IS_ENABLED(CONFIG_KEYBOARD_GPIO) #include <linux/input.h> #include <linux/gpio_keys.h> @@ -509,7 +507,7 @@ static struct platform_device bfin_device_gpiokeys = { }; #endif -#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) +#if IS_ENABLED(CONFIG_I2C_GPIO) #include <linux/i2c-gpio.h> static struct i2c_gpio_platform_data i2c_gpio_data = { @@ -530,29 +528,29 @@ static struct platform_device i2c_gpio_device = { #endif static struct i2c_board_info __initdata bfin_i2c_board_info[] = { -#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) +#if IS_ENABLED(CONFIG_JOYSTICK_AD7142) { I2C_BOARD_INFO("ad7142_joystick", 0x2C), .irq = 39, }, #endif -#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) +#if IS_ENABLED(CONFIG_BFIN_TWI_LCD) { I2C_BOARD_INFO("pcf8574_lcd", 0x22), }, #endif -#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) +#if IS_ENABLED(CONFIG_INPUT_PCF8574) { I2C_BOARD_INFO("pcf8574_keypad", 0x27), .irq = 39, }, #endif -#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) +#if IS_ENABLED(CONFIG_FB_BFIN_7393) { I2C_BOARD_INFO("bfin-adv7393", 0x2B), }, #endif -#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) +#if IS_ENABLED(CONFIG_BFIN_TWI_LCD) { I2C_BOARD_INFO("ad5252", 0x2f), }, @@ -586,9 +584,8 @@ static struct platform_device bfin_dpmc = { }, }; -#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ - defined(CONFIG_SND_BF5XX_AC97) || \ - defined(CONFIG_SND_BF5XX_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) || \ + IS_ENABLED(CONFIG_SND_BF5XX_AC97) #include <asm/bfin_sport.h> @@ -640,22 +637,21 @@ static struct resource bfin_snd_resources[][4] = { }; #endif -#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) static struct platform_device bfin_i2s_pcm = { .name = "bfin-i2s-pcm-audio", .id = -1, }; #endif -#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_AC97) static struct platform_device bfin_ac97_pcm = { .name = "bfin-ac97-pcm-audio", .id = -1, }; #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ - || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836) static const char * const ad1836_link[] = { "bfin-i2s.0", "spi0.4", @@ -669,8 +665,7 @@ static struct platform_device bfin_ad1836_machine = { }; #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \ - defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311) static const unsigned ad73311_gpio[] = { GPIO_PF4, }; @@ -684,22 +679,21 @@ static struct platform_device bfin_ad73311_machine = { }; #endif -#if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_AD73311) static struct platform_device bfin_ad73311_codec_device = { .name = "ad73311", .id = -1, }; #endif -#if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_AD74111) static struct platform_device bfin_ad74111_codec_device = { .name = "ad74111", .id = -1, }; #endif -#if defined(CONFIG_SND_BF5XX_SOC_I2S) || \ - defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S) static struct platform_device bfin_i2s = { .name = "bfin-i2s", .id = CONFIG_SND_BF5XX_SPORT_NUM, @@ -712,8 +706,7 @@ static struct platform_device bfin_i2s = { }; #endif -#if defined(CONFIG_SND_BF5XX_SOC_AC97) || \ - defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97) static struct platform_device bfin_ac97 = { .name = "bfin-ac97", .id = CONFIG_SND_BF5XX_SPORT_NUM, @@ -730,36 +723,35 @@ static struct platform_device *stamp_devices[] __initdata = { &bfin_dpmc, -#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) +#if IS_ENABLED(CONFIG_RTC_DRV_BFIN) &rtc_device, #endif -#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#if IS_ENABLED(CONFIG_SMC91X) &smc91x_device, #endif -#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) +#if IS_ENABLED(CONFIG_USB_NET2272) &net2272_bfin_device, #endif -#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) +#if IS_ENABLED(CONFIG_SPI_BFIN5XX) &bfin_spi0_device, #endif -#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) +#if IS_ENABLED(CONFIG_SERIAL_BFIN) #ifdef CONFIG_SERIAL_BFIN_UART0 &bfin_uart0_device, #endif #endif -#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) +#if IS_ENABLED(CONFIG_BFIN_SIR) #ifdef CONFIG_BFIN_SIR0 &bfin_sir0_device, #endif #endif -#if defined(CONFIG_SERIAL_BFIN_SPORT) || \ - defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) +#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT) #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART &bfin_sport0_uart_device, #endif @@ -768,58 +760,54 @@ static struct platform_device *stamp_devices[] __initdata = { #endif #endif -#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) +#if IS_ENABLED(CONFIG_KEYBOARD_GPIO) &bfin_device_gpiokeys, #endif -#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) +#if IS_ENABLED(CONFIG_I2C_GPIO) &i2c_gpio_device, #endif -#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) +#if IS_ENABLED(CONFIG_MTD_BFIN_ASYNC) &stamp_flash_device, #endif -#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) &bfin_i2s_pcm, #endif -#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_AC97) &bfin_ac97_pcm, #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ - defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836) &bfin_ad1836_machine, #endif -#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \ - defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311) &bfin_ad73311_machine, #endif -#if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_AD73311) &bfin_ad73311_codec_device, #endif -#if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE) +#if IS_ENABLED(CONFIG_SND_SOC_AD74111) &bfin_ad74111_codec_device, #endif -#if defined(CONFIG_SND_BF5XX_SOC_I2S) || \ - defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S) &bfin_i2s, #endif -#if defined(CONFIG_SND_BF5XX_SOC_AC97) || \ - defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) +#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97) &bfin_ac97, #endif }; static int __init net2272_init(void) { -#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) +#if IS_ENABLED(CONFIG_USB_NET2272) int ret; /* Set PF0 to 0, PF1 to 1 make /AMS3 work properly */ @@ -865,7 +853,7 @@ static int __init stamp_init(void) if (ret < 0) return ret; -#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) +#if IS_ENABLED(CONFIG_SMC91X) /* * setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC. * the bfin-async-map driver takes care of flipping between |