ARM: 6323/1: cam60: don't use __init for cam60_spi_{flash_platform_data,partitions}
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 10 Aug 2010 21:17:19 +0000 (22:17 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 10 Aug 2010 21:46:56 +0000 (22:46 +0100)
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 12/19] ARM: cam60: don't use __init for cam60_spi_{flash_platform_data,partitions}
Date: Thu,  5 Aug 2010 16:08:46 +0200
Message-Id: <1281017333-5563-12-git-send-email-u.kleine-koenig@pengutronix.de>

These two structs are referenced by cam60_spi_devices.  The latter is
copied at init time to kmalloced memory and so the copy isn't freed after
booting.  So it must not contain references to .init memory.

This isn't noticed by modpost as cam60_spi_devices is in .init.data, too.

Noticed-and-Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-at91/board-cam60.c

index 05c70728f041ba8fb05846ac18ce052a8068fa1d..44eb9f764938985abd52f7d285ad1b456507594c 100644 (file)
@@ -75,7 +75,7 @@ static struct at91_usbh_data __initdata cam60_usbh_data = {
  * SPI devices.
  */
 #if defined(CONFIG_MTD_DATAFLASH)
-static struct mtd_partition __initdata cam60_spi_partitions[] = {
+static struct mtd_partition cam60_spi_partitions[] = {
        {
                .name   = "BOOT1",
                .offset = 0,
@@ -98,7 +98,7 @@ static struct mtd_partition __initdata cam60_spi_partitions[] = {
        },
 };
 
-static struct flash_platform_data cam60_spi_flash_platform_data __initdata = {
+static struct flash_platform_data cam60_spi_flash_platform_data = {
        .name           = "spi_flash",
        .parts          = cam60_spi_partitions,
        .nr_parts       = ARRAY_SIZE(cam60_spi_partitions)