* [PATCH] ARM: OMAP: Fix building with CONFIG_OMAP_GPIO_SWITCH off.
@ 2007-05-22 17:25 andrzej zaborowski
2007-05-25 0:34 ` Tony Lindgren
0 siblings, 1 reply; 4+ messages in thread
From: andrzej zaborowski @ 2007-05-22 17:25 UTC (permalink / raw)
To: Linux OMAP ML
[-- 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 --]
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] ARM: OMAP: Fix building with CONFIG_OMAP_GPIO_SWITCH off.
2007-05-22 17:25 [PATCH] ARM: OMAP: Fix building with CONFIG_OMAP_GPIO_SWITCH off andrzej zaborowski
@ 2007-05-25 0:34 ` Tony Lindgren
2007-05-27 12:57 ` andrzej zaborowski
0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2007-05-25 0:34 UTC (permalink / raw)
To: andrzej zaborowski; +Cc: Linux OMAP ML
* andrzej zaborowski <balrogg@gmail.com> [070522 10:26]:
> 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>
> @@ -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
>
Can you please put the extern functions into a header file?
We got some comments on that on LKML few weeks ago.
Tony
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] ARM: OMAP: Fix building with CONFIG_OMAP_GPIO_SWITCH off.
2007-05-25 0:34 ` Tony Lindgren
@ 2007-05-27 12:57 ` andrzej zaborowski
2007-06-05 10:34 ` Tony Lindgren
0 siblings, 1 reply; 4+ messages in thread
From: andrzej zaborowski @ 2007-05-27 12:57 UTC (permalink / raw)
To: Tony Lindgren; +Cc: Linux OMAP ML
On 25/05/07, Tony Lindgren <tony@atomide.com> wrote:
> * andrzej zaborowski <balrogg@gmail.com> [070522 10:26]:
> > 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>
>
> > @@ -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
> >
>
> Can you please put the extern functions into a header file?
> We got some comments on that on LKML few weeks ago.
Sorry, not sure which functions/header you mean?
Andrzej
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] ARM: OMAP: Fix building with CONFIG_OMAP_GPIO_SWITCH off.
2007-05-27 12:57 ` andrzej zaborowski
@ 2007-06-05 10:34 ` Tony Lindgren
0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2007-06-05 10:34 UTC (permalink / raw)
To: andrzej zaborowski; +Cc: Linux OMAP ML
* andrzej zaborowski <balrogg@gmail.com> [070527 05:57]:
> On 25/05/07, Tony Lindgren <tony@atomide.com> wrote:
>> * andrzej zaborowski <balrogg@gmail.com> [070522 10:26]:
>> > 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>
>>
>> > @@ -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
>> >
>>
>> Can you please put the extern functions into a header file?
>> We got some comments on that on LKML few weeks ago.
>
> Sorry, not sure which functions/header you mean?
We are not supposed to have prototypes for extern functions in .c files,
they should be in .h files.
Tony
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-06-05 10:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-22 17:25 [PATCH] ARM: OMAP: Fix building with CONFIG_OMAP_GPIO_SWITCH off andrzej zaborowski
2007-05-25 0:34 ` Tony Lindgren
2007-05-27 12:57 ` andrzej zaborowski
2007-06-05 10:34 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox