linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided
@ 2011-12-22 14:00 Ilya Yanok
  2012-03-05 19:58 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Yanok @ 2011-12-22 14:00 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel; +Cc: sasha_d, Ilya Yanok, Igor Grinberg

If platform data is provided by the caller gpio_pendown is put into
unused static ads7846_config structure and effectively has no effect.
Of course caller can set gpio_pendown field in platform data himself
but it seems natural to do this in ads7846_init to remove duplication.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Ilya Yanok <yanok@emcraft.com>

---
Changes from V1:

 - existing if clause reused

 arch/arm/mach-omap2/common-board-devices.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
index 2d1d775..9498b0f 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -75,13 +75,15 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 			gpio_set_debounce(gpio_pendown, gpio_debounce);
 	}
 
-	ads7846_config.gpio_pendown = gpio_pendown;
-
 	spi_bi->bus_num	= bus_num;
 	spi_bi->irq	= OMAP_GPIO_IRQ(gpio_pendown);
 
-	if (board_pdata)
+	if (board_pdata) {
+		board_pdata->gpio_pendown = gpio_pendown;
 		spi_bi->platform_data = board_pdata;
+	} else {
+		ads7846_config.gpio_pendown = gpio_pendown;
+	}
 
 	spi_register_board_info(&ads7846_spi_board_info, 1);
 }
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided
  2011-12-22 14:00 [PATCH V2] OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided Ilya Yanok
@ 2012-03-05 19:58 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2012-03-05 19:58 UTC (permalink / raw)
  To: Ilya Yanok; +Cc: linux-omap, linux-arm-kernel, sasha_d, Igor Grinberg

* Ilya Yanok <yanok@emcraft.com> [111222 05:29]:
> If platform data is provided by the caller gpio_pendown is put into
> unused static ads7846_config structure and effectively has no effect.
> Of course caller can set gpio_pendown field in platform data himself
> but it seems natural to do this in ads7846_init to remove duplication.

Thanks applying into fixes-non-critical-part2.

Regards,

Tony

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-05 19:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-22 14:00 [PATCH V2] OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided Ilya Yanok
2012-03-05 19:58 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).