* [PATCH] Make H2 board file compile without irda warning
@ 2006-02-21 17:54 Daniel Petrini
2006-02-21 21:28 ` Komal Shah
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Petrini @ 2006-02-21 17:54 UTC (permalink / raw)
To: OMAP-Linux
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
Hi,
The board file for H2 is generating a warning if compiled without
InfraRed selection.
This patch changes the location where the function h2_transceiver_mode
is assigned to structure h2_irda_data, thereby preventing the warning.
Signed-off-by Daniel Petrini <d.pensator_at_gmail.com>
Daniel Petrini
--
INdT - Manaus - Brazil
[-- Attachment #2: h2-irda-compile.patch --]
[-- Type: text/x-patch, Size: 1076 bytes --]
Index: linux-omap-2.6.git-q/arch/arm/mach-omap1/board-h2.c
===================================================================
--- linux-omap-2.6.git-q.orig/arch/arm/mach-omap1/board-h2.c 2006-02-21 10:11:01.000000000 -0400
+++ linux-omap-2.6.git-q/arch/arm/mach-omap1/board-h2.c 2006-02-21 11:28:18.000000000 -0400
@@ -252,6 +252,7 @@ static int h2_transceiver_mode(struct de
static struct omap_irda_config h2_irda_data = {
.transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
+ .transceiver_mode = h2_transceiver_mode,
};
static struct resource h2_irda_resources[] = {
@@ -377,10 +378,8 @@ static void __init h2_init(void)
/* Irda */
#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
- if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) {
+ if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN)))
omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0);
- h2_irda_data.transceiver_mode = h2_transceiver_mode;
- }
#endif
platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Make H2 board file compile without irda warning 2006-02-21 17:54 [PATCH] Make H2 board file compile without irda warning Daniel Petrini @ 2006-02-21 21:28 ` Komal Shah 2006-02-21 21:54 ` Komal Shah 0 siblings, 1 reply; 7+ messages in thread From: Komal Shah @ 2006-02-21 21:28 UTC (permalink / raw) To: Daniel Petrini, OMAP-Linux --- Daniel Petrini <d.pensator@gmail.com> wrote: > Hi, > > The board file for H2 is generating a warning if compiled without > InfraRed selection. > > This patch changes the location where the function > h2_transceiver_mode > is assigned to structure h2_irda_data, thereby preventing the > warning. True, the warning will be generated, but I added that check considering that transceiver_mode function will be active only if we are successfully able to request that GPIO. So, I am _not_ sure, but it is better to #ifdef around the h2_transceiver_mode(...) function. What do you think? ---Komal Shah http://komalshah.blogspot.com/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Make H2 board file compile without irda warning 2006-02-21 21:28 ` Komal Shah @ 2006-02-21 21:54 ` Komal Shah 2006-02-22 13:18 ` Daniel Petrini 0 siblings, 1 reply; 7+ messages in thread From: Komal Shah @ 2006-02-21 21:54 UTC (permalink / raw) To: Daniel Petrini, OMAP-Linux [-- Attachment #1: Type: text/plain, Size: 760 bytes --] --- Komal Shah <komal_shah802003@yahoo.com> wrote: > > True, the warning will be generated, but I added that check > considering > that transceiver_mode function will be active only if we are > successfully able to request that GPIO. So, I am _not_ sure, but it > is > better to #ifdef around the h2_transceiver_mode(...) function. What > do > you think? > And here comes the patch. OMAP: Irda: Remove warning arch/arm/mach-omap1/board-h2.c:244: warning: 'h2_transceiver_mode' defined but not used. Signed-off-by: Komal Shah <komal_shah802003@yahoo.com> ---Komal Shah http://komalshah.blogspot.com/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com [-- Attachment #2: 390387012-h2Irda.patch --] [-- Type: application/octet-stream, Size: 634 bytes --] diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 680e67e..cbc7674 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c @@ -240,6 +240,7 @@ static struct platform_device h2_kp_devi #define H2_IRDA_FIRSEL_GPIO_PIN 17 +#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) static int h2_transceiver_mode(struct device *dev, int state) { if (state & IR_SIRMODE) @@ -249,6 +250,7 @@ static int h2_transceiver_mode(struct de return 0; } +#endif static struct omap_irda_config h2_irda_data = { .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, [-- Attachment #3: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Make H2 board file compile without irda warning 2006-02-21 21:54 ` Komal Shah @ 2006-02-22 13:18 ` Daniel Petrini 2006-02-22 13:40 ` Daniel Petrini 0 siblings, 1 reply; 7+ messages in thread From: Daniel Petrini @ 2006-02-22 13:18 UTC (permalink / raw) To: Komal Shah; +Cc: OMAP-Linux [-- Attachment #1: Type: text/plain, Size: 1345 bytes --] Hi, On 2/21/06, Komal Shah <komal_shah802003@yahoo.com> wrote: > --- Komal Shah <komal_shah802003@yahoo.com> wrote: > > > > > True, the warning will be generated, but I added that check > > considering > > that transceiver_mode function will be active only if we are > > successfully able to request that GPIO. So, I am _not_ sure, but it > > is > > better to #ifdef around the h2_transceiver_mode(...) function. What > > do > > you think? > > > > And here comes the patch. > > OMAP: Irda: Remove warning > arch/arm/mach-omap1/board-h2.c:244: warning: 'h2_transceiver_mode' > defined but not used. > > Signed-off-by: Komal Shah <komal_shah802003@yahoo.com> > > ---Komal Shah > http://komalshah.blogspot.com/ Humm, my first idea was exactly like this but I tried to avoid another #ifdef.. So what about this new approach, which still avoids #ifdefs although with expense of one flag ? -- The board file for H2 is generating a warning if compiled without InfraRed selection. This patch changes the location where the function h2_transceiver_mode is assigned to structure h2_irda_data, thereby preventing the warning and also creates a flag variable telling when is safe to use h2 platform function for IR. Signed-off-by Daniel Petrini <d.pensator_at_gmail.com> Daniel -- INdT - Manaus - Brazil [-- Attachment #2: h2-irda-compile.patch --] [-- Type: text/x-patch, Size: 1484 bytes --] Index: linux-omap-2.6.git-q/arch/arm/mach-omap1/board-h2.c =================================================================== --- linux-omap-2.6.git-q.orig/arch/arm/mach-omap1/board-h2.c 2006-02-21 10:11:01.000000000 -0400 +++ linux-omap-2.6.git-q/arch/arm/mach-omap1/board-h2.c 2006-02-22 08:54:16.000000000 -0400 @@ -252,6 +252,8 @@ static int h2_transceiver_mode(struct de static struct omap_irda_config h2_irda_data = { .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, + .transceiver_mode = h2_transceiver_mode, + .irda_capable = 0, }; static struct resource h2_irda_resources[] = { @@ -379,7 +381,7 @@ static void __init h2_init(void) omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A); if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) { omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0); - h2_irda_data.transceiver_mode = h2_transceiver_mode; + h2_irda_data.irda_capable = 1; } #endif Index: linux-omap-2.6.git-q/include/asm-arm/arch-omap/irda.h =================================================================== --- linux-omap-2.6.git-q.orig/include/asm-arm/arch-omap/irda.h 2006-02-22 09:00:30.000000000 -0400 +++ linux-omap-2.6.git-q/include/asm-arm/arch-omap/irda.h 2006-02-22 09:01:02.000000000 -0400 @@ -25,6 +25,8 @@ struct omap_irda_config { * having calls which can sleep in irda_set_speed. */ struct work_struct gpio_expa; + /* Very specific to H2 - success in obtain gpio */ + int irda_capable; }; #endif [-- Attachment #3: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Make H2 board file compile without irda warning 2006-02-22 13:18 ` Daniel Petrini @ 2006-02-22 13:40 ` Daniel Petrini 2006-02-22 16:16 ` Komal Shah 0 siblings, 1 reply; 7+ messages in thread From: Daniel Petrini @ 2006-02-22 13:40 UTC (permalink / raw) To: Komal Shah; +Cc: OMAP-Linux [-- Attachment #1: Type: text/plain, Size: 1497 bytes --] Ops, here goes the proper patch: On 2/22/06, Daniel Petrini <d.pensator@gmail.com> wrote: > Hi, > > On 2/21/06, Komal Shah <komal_shah802003@yahoo.com> wrote: > > --- Komal Shah <komal_shah802003@yahoo.com> wrote: > > > > > > > > True, the warning will be generated, but I added that check > > > considering > > > that transceiver_mode function will be active only if we are > > > successfully able to request that GPIO. So, I am _not_ sure, but it > > > is > > > better to #ifdef around the h2_transceiver_mode(...) function. What > > > do > > > you think? > > > > > > > And here comes the patch. > > > > OMAP: Irda: Remove warning > > arch/arm/mach-omap1/board-h2.c:244: warning: 'h2_transceiver_mode' > > defined but not used. > > > > Signed-off-by: Komal Shah <komal_shah802003@yahoo.com> > > > > ---Komal Shah > > http://komalshah.blogspot.com/ > Humm, my first idea was exactly like this but I tried to avoid another #ifdef.. So what about this new approach, which still avoids #ifdefs although with expense of one flag ? -- The board file for H2 is generating a warning if compiled without InfraRed selection. This patch changes the location where the function h2_transceiver_mode is assigned to structure h2_irda_data, thereby preventing the warning and also creates a flag variable telling when is safe to use h2 platform function for IR. Signed-off-by Daniel Petrini <d.pensator_at_gmail.com> Daniel -- INdT - Manaus - Brazil [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: h2-irda-compile.patch --] [-- Type: text/x-patch; name="h2-irda-compile.patch", Size: 2100 bytes --] Index: linux-omap-2.6.git-q/arch/arm/mach-omap1/board-h2.c =================================================================== --- linux-omap-2.6.git-q.orig/arch/arm/mach-omap1/board-h2.c 2006-02-21 10:11:01.000000000 -0400 +++ linux-omap-2.6.git-q/arch/arm/mach-omap1/board-h2.c 2006-02-22 08:54:16.000000000 -0400 @@ -252,6 +252,8 @@ static int h2_transceiver_mode(struct de static struct omap_irda_config h2_irda_data = { .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, + .transceiver_mode = h2_transceiver_mode, + .irda_capable = 0, }; static struct resource h2_irda_resources[] = { @@ -379,7 +381,7 @@ static void __init h2_init(void) omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A); if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) { omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0); - h2_irda_data.transceiver_mode = h2_transceiver_mode; + h2_irda_data.irda_capable = 1; } #endif Index: linux-omap-2.6.git-q/include/asm-arm/arch-omap/irda.h =================================================================== --- linux-omap-2.6.git-q.orig/include/asm-arm/arch-omap/irda.h 2006-02-22 09:00:30.000000000 -0400 +++ linux-omap-2.6.git-q/include/asm-arm/arch-omap/irda.h 2006-02-22 09:01:02.000000000 -0400 @@ -25,6 +25,8 @@ struct omap_irda_config { * having calls which can sleep in irda_set_speed. */ struct work_struct gpio_expa; + /* Very specific to H2 - success in obtain gpio */ + int irda_capable; }; #endif Index: linux-omap-2.6.git-q/drivers/net/irda/omap-ir.c =================================================================== --- linux-omap-2.6.git-q.orig/drivers/net/irda/omap-ir.c 2006-02-14 08:24:54.000000000 -0400 +++ linux-omap-2.6.git-q/drivers/net/irda/omap-ir.c 2006-02-22 09:02:27.000000000 -0400 @@ -336,7 +336,7 @@ static int omap_irda_startup(struct net_ /* Only for H2? */ - if (si->pdata->transceiver_mode && machine_is_omap_h2()) { + if (si->pdata->irda_capable && machine_is_omap_h2()) { /* Is it select_irda on H2 ? */ omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A); [-- Attachment #3: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Make H2 board file compile without irda warning 2006-02-22 13:40 ` Daniel Petrini @ 2006-02-22 16:16 ` Komal Shah 2006-02-25 1:10 ` Tony Lindgren 0 siblings, 1 reply; 7+ messages in thread From: Komal Shah @ 2006-02-22 16:16 UTC (permalink / raw) To: Daniel Petrini; +Cc: OMAP-Linux --- Daniel Petrini <d.pensator@gmail.com> wrote: > > Humm, my first idea was exactly like this but I tried to avoid > another #ifdef.. > So what about this new approach, which still avoids #ifdefs although > with expense of one flag ? > I am now in confusion :). I like your patch too, but I thought that adding #ifdef in board-* files is no harm. So, let's Tony speak :) ---Komal Shah http://komalshah.blogspot.com/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Make H2 board file compile without irda warning 2006-02-22 16:16 ` Komal Shah @ 2006-02-25 1:10 ` Tony Lindgren 0 siblings, 0 replies; 7+ messages in thread From: Tony Lindgren @ 2006-02-25 1:10 UTC (permalink / raw) To: Komal Shah; +Cc: OMAP-Linux * Komal Shah <komal_shah802003@yahoo.com> [060222 09:26]: > --- Daniel Petrini <d.pensator@gmail.com> wrote: > > > > > Humm, my first idea was exactly like this but I tried to avoid > > another #ifdef.. > > So what about this new approach, which still avoids #ifdefs although > > with expense of one flag ? > > > > I am now in confusion :). I like your patch too, but I thought that > adding #ifdef in board-* files is no harm. So, let's Tony speak :) Both work, but let's use the smaller codesize one at the expense of one ifdef :) I'll push Komal's patch today. Tony ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-02-25 1:10 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-02-21 17:54 [PATCH] Make H2 board file compile without irda warning Daniel Petrini 2006-02-21 21:28 ` Komal Shah 2006-02-21 21:54 ` Komal Shah 2006-02-22 13:18 ` Daniel Petrini 2006-02-22 13:40 ` Daniel Petrini 2006-02-22 16:16 ` Komal Shah 2006-02-25 1:10 ` Tony Lindgren
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox