gpio: tegra: add valid configuration for Tegra30
Varun Wadekar [Sat, 21 Apr 2012 10:10:35 +0000 (15:10 +0530)]
In case the "compatible" property is not populated, which can happen
when we load devices from board files, use a valid config struct for
Tegra30 instead of re-using the one written for Tegra20.

Bug 971673

Change-Id: I863e4eec8a860995b72f0a7ceeab25213dfa9bc7
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/98127
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Tested-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>

drivers/gpio/gpio-tegra.c

index b347b18..1c50690 100644 (file)
@@ -465,7 +465,11 @@ static int __devinit tegra_gpio_probe(struct platform_device *pdev)
        if (match)
                config = (struct tegra_gpio_soc_config *)match->data;
        else
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
                config = &tegra20_gpio_config;
+#else
+               config = &tegra30_gpio_config;
+#endif
 
        tegra_gpio_bank_stride = config->bank_stride;
        tegra_gpio_upper_offset = config->upper_offset;