diff options
author | Ilya Yanok <yanok@emcraft.com> | 2012-03-06 04:11:02 +0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-03-06 04:11:02 +0400 |
commit | 7db74d5e327197289f2eb83c13f8d1b565a21467 (patch) | |
tree | 5c6e7e365f27d2a06f5f13ce41ebbcf2e5d65393 /arch/arm/mach-omap2/common-board-devices.c | |
parent | 17e22caccfcefc3f45ab5eaafe7279ada3b3fbd6 (diff) | |
download | linux-7db74d5e327197289f2eb83c13f8d1b565a21467.tar.xz |
ARM: OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided
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>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/common-board-devices.c')
-rw-r--r-- | 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 bcb0c5817167..799a617ade30 100644 --- a/arch/arm/mach-omap2/common-board-devices.c +++ b/arch/arm/mach-omap2/common-board-devices.c @@ -76,13 +76,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); } |