diff options
author | Andrew Howe <ahowe@nvidia.com> | 2010-07-29 17:44:14 +0300 |
---|---|---|
committer | Antti Hatala <ahatala@nvidia.com> | 2010-08-04 08:43:32 -0700 |
commit | 28e16c0b27d120ae789ece0f4ddd84f54e05828d (patch) | |
tree | cd50ac53a3785cfef99bb9d1accf09d57aa79ca3 | |
parent | 50b4cb2f36c488ade2c1bbe8bab2f356479e64f9 (diff) |
[ARM/tegra] pinmux: fix kernel crash during debugfs output
'cat sys/kernel/debug/tegra_pinmux' was crashing the kernel because
the wrong register field was being checked for validity.
Also, move offset addition to improve code generation for pg_readl
and pg_writel. The IO_TO_VIRT macro ideally wants a constant argument.
Change-Id: I6b24b1ac9034b2fedf330757ea5bed6a984af116
Reviewed-on: http://git-master/r/4545
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Gary King <gking@nvidia.com>
Tested-by: Andrew Howe <ahowe@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/pinmux.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/pinmux.c b/arch/arm/mach-tegra/pinmux.c index 390c48a98455..b1a4d900158b 100644 --- a/arch/arm/mach-tegra/pinmux.c +++ b/arch/arm/mach-tegra/pinmux.c @@ -150,12 +150,12 @@ static const char *pupd_name(unsigned long val) static inline unsigned long pg_readl(unsigned long offset) { - return readl(IO_TO_VIRT(TEGRA_APB_MISC_BASE + offset)); + return readl(IO_TO_VIRT(TEGRA_APB_MISC_BASE) + offset); } static inline void pg_writel(unsigned long value, unsigned long offset) { - writel(value, IO_TO_VIRT(TEGRA_APB_MISC_BASE + offset)); + writel(value, IO_TO_VIRT(TEGRA_APB_MISC_BASE) + offset); } static int tegra_pinmux_cancel_func(const struct tegra_pingroup_config *config) @@ -511,7 +511,7 @@ static int dbg_pinmux_show(struct seq_file *s, void *unused) } dbg_pad_field(s, 13-len); - if (pingroups[i].mux_reg < 0) { + if (pingroups[i].pupd_reg < 0) { seq_printf(s, "TEGRA_PUPD_NORMAL"); len = strlen("NORMAL"); } else { |