[PATCH] blackfin: dnp5370: Fix some SPI-related build errors

From: Anton Vorontsov
Date: Sat Mar 24 2012 - 06:39:48 EST


Some SPI #ifdef magic was wrong, and so the build stopped like this
(using DNP5370_defconfig):

arch/blackfin/mach-bf537/boards/dnp5370.c: In function 'dnp5370_init':
arch/blackfin/mach-bf537/boards/dnp5370.c:392: error: 'bfin_spi_board_info' undeclared (first use in this function)
arch/blackfin/mach-bf537/boards/dnp5370.c:392: error: (Each undeclared identifier is reported only once
arch/blackfin/mach-bf537/boards/dnp5370.c:392: error: for each function it appears in.)
arch/blackfin/mach-bf537/boards/dnp5370.c:392: warning: type defaults to 'int' in declaration of 'type name'
arch/blackfin/mach-bf537/boards/dnp5370.c:392: warning: type defaults to 'int' in declaration of 'type name'
arch/blackfin/mach-bf537/boards/dnp5370.c:392: error: negative width in bit-field '<anonymous>'
arch/blackfin/mach-bf537/boards/dnp5370.c:393: warning: type defaults to 'int' in declaration of 'type name'
arch/blackfin/mach-bf537/boards/dnp5370.c:393: warning: type defaults to 'int' in declaration of 'type name'
arch/blackfin/mach-bf537/boards/dnp5370.c:393: error: negative width in bit-field '<anonymous>'

This patch fixes the issues by properly placing bfin_spi_board_info.

Signed-off-by: Anton Vorontsov <anton.vorontsov@xxxxxxxxxx>
---
arch/blackfin/mach-bf537/boards/dnp5370.c | 56 +++++++++++++++--------------
1 file changed, 29 insertions(+), 27 deletions(-)

diff --git a/arch/blackfin/mach-bf537/boards/dnp5370.c b/arch/blackfin/mach-bf537/boards/dnp5370.c
index 11dadeb..e7fb430 100644
--- a/arch/blackfin/mach-bf537/boards/dnp5370.c
+++ b/arch/blackfin/mach-bf537/boards/dnp5370.c
@@ -164,33 +164,6 @@ static struct bfin5xx_spi_chip spi_dataflash_chip_info = {
};
#endif

-static struct spi_board_info bfin_spi_board_info[] __initdata = {
-/* SD/MMC card reader at SPI bus */
-#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
- {
- .modalias = "mmc_spi",
- .max_speed_hz = 20000000,
- .bus_num = 0,
- .chip_select = 1,
- .controller_data = &mmc_spi_chip_info,
- .mode = SPI_MODE_3,
- },
-#endif
-
-/* 8 Megabyte Atmel NOR flash chip at SPI bus */
-#if defined(CONFIG_MTD_DATAFLASH) || defined(CONFIG_MTD_DATAFLASH_MODULE)
- {
- .modalias = "mtd_dataflash",
- .max_speed_hz = 16700000,
- .bus_num = 0,
- .chip_select = 2,
- .platform_data = &bfin_spi_dataflash_data,
- .controller_data = &spi_dataflash_chip_info,
- .mode = SPI_MODE_3, /* SPI_CPHA and SPI_CPOL */
- },
-#endif
-};
-
/* SPI controller data */
/* SPI (0) */
static struct resource bfin_spi0_resource[] = {
@@ -228,6 +201,35 @@ static struct platform_device spi_bfin_master_device = {
};
#endif

+static struct spi_board_info bfin_spi_board_info[] __initdata = {
+#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
+/* SD/MMC card reader at SPI bus */
+#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
+ {
+ .modalias = "mmc_spi",
+ .max_speed_hz = 20000000,
+ .bus_num = 0,
+ .chip_select = 1,
+ .controller_data = &mmc_spi_chip_info,
+ .mode = SPI_MODE_3,
+ },
+#endif
+
+/* 8 Megabyte Atmel NOR flash chip at SPI bus */
+#if defined(CONFIG_MTD_DATAFLASH) || defined(CONFIG_MTD_DATAFLASH_MODULE)
+ {
+ .modalias = "mtd_dataflash",
+ .max_speed_hz = 16700000,
+ .bus_num = 0,
+ .chip_select = 2,
+ .platform_data = &bfin_spi_dataflash_data,
+ .controller_data = &spi_dataflash_chip_info,
+ .mode = SPI_MODE_3, /* SPI_CPHA and SPI_CPOL */
+ },
+#endif
+#endif /* defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) */
+};
+
#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
#ifdef CONFIG_SERIAL_BFIN_UART0
static struct resource bfin_uart0_resources[] = {
--
1.7.9.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/