[PATCH] ARM: OMAP: Fix building with CONFIG_OMAP_GPIO_SWITCH off.

andrzej zaborowski
2007-05-22T17:25:14Z

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

Define omap_register_gpio_switches when CONFIG_OMAP_GPIO_SWITCH is
off. This will prevent adding a CONFIG_OMAP_GPIO_SWITCH check in the
board files and enable building board-palmte.c with gpio-switch off.
Also add __initdata to the two variables in gpio-switch that are used only
during init.

Signed-off-by: Andrzej Zaborowski <balrog@zabor.org>

[-- Attachment #2: 0005-ARM-OMAP-Define-omap_register_gpio_switches-when-CONFIG_OMAP_GPIO_SWITCH.txt --]
[-- Type: text/plain, Size: 2130 bytes --]

From 0529492f54492f4ab8e7dd4d655cc146ed3eee71 Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <balrog@zabor.org>
Date: Tue, 22 May 2007 20:13:41 +0200
Subject: [PATCH] ARM: OMAP: Define omap_register_gpio_switches when CONFIG_OMAP_GPIO_SWITCH
is off.

This will prevent adding a CONFIG_OMAP_GPIO_SWITCH check in the board files
and enable building board-palmte.c with gpio-switch off.
Also add __initdata to the two variables in gpio-switch that are used only
during init.
---
arch/arm/plat-omap/gpio-switch.c | 4 ++--
include/asm-arm/arch-omap/gpio-switch.h | 10 ++++++++--
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/gpio-switch.c b/arch/arm/plat-omap/gpio-switch.c
index cd96c00..483fdfd 100644
--- a/arch/arm/plat-omap/gpio-switch.c
+++ b/arch/arm/plat-omap/gpio-switch.c
@@ -51,8 +51,8 @@ static LIST_HEAD(gpio_switches);
static struct platform_device *gpio_sw_platform_dev;
static struct platform_driver gpio_sw_driver;

-static const struct omap_gpio_switch *board_gpio_sw_table;
-static int board_gpio_sw_count;
+static const struct omap_gpio_switch *board_gpio_sw_table __initdata;
+static int board_gpio_sw_count __initdata;

static const char *cover_str[2] = { "open", "closed" };
static const char *connection_str[2] = { "disconnected", "connected" };
diff --git a/include/asm-arm/arch-omap/gpio-switch.h b/include/asm-arm/arch-omap/gpio-switch.h
index 10da0e0..570c24c 100644
--- a/include/asm-arm/arch-omap/gpio-switch.h
+++ b/include/asm-arm/arch-omap/gpio-switch.h
@@ -12,6 +12,7 @@
#define __ASM_ARCH_OMAP_GPIO_SWITCH_H

#include <linux/types.h>
+#include <linux/autoconf.h>

/* Cover:
* high -> closed
@@ -48,7 +49,12 @@ struct omap_gpio_switch {
};

/* Call at init time only */
-extern void omap_register_gpio_switches(const struct omap_gpio_switch *tbl,
- int count);
+#ifdef CONFIG_OMAP_GPIO_SWITCH
+extern void omap_register_gpio_switches(
+ const struct omap_gpio_switch *tbl, int count);
+#else
+static inline void omap_register_gpio_switches(
+ const struct omap_gpio_switch *tbl, int count) {}
+#endif

#endif
--
1.4.4.3

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]