public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blackfin: dnp5370: Fix some SPI-related build errors
@ 2012-03-24 10:38 Anton Vorontsov
  0 siblings, 0 replies; only message in thread
From: Anton Vorontsov @ 2012-03-24 10:38 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Bob Liu, Sonic Zhang, Paul Gortmaker, uclinux-dist-devel,
	linux-kernel

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@linaro.org>
---
 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-24 10:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-24 10:38 [PATCH] blackfin: dnp5370: Fix some SPI-related build errors Anton Vorontsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox