arm: tegra: pinmux: debugfs: Handling INVALID pinmux option
Laxman Dewangan [Sat, 28 May 2011 14:12:54 +0000 (19:12 +0530)]
When any pinmux is selected as INVALID option, may be POR, taking
dump of pinmux through debugfs interface is displaying junk character/
crashing the kernel.

Fixing this issue by handling correctly the INVALID option.

Original-Change-Id: I32c0ad0ba12ea44bc8fd1e2ec2ccb50269210f67
Reviewed-on: http://git-master/r/34429
Reviewed-by: Niket Sirsi <nsirsi@nvidia.com>
Tested-by: Niket Sirsi <nsirsi@nvidia.com>

Rebase-Id: R4f7f4f9af4640b0858c384ce4982317635b8b6ad

arch/arm/mach-tegra/pinmux.c

index 279e71c..f018b0a 100644 (file)
@@ -1072,7 +1072,10 @@ static int dbg_pinmux_show(struct seq_file *s, void *unused)
                                        pingroups[i].mux_reg);
                        mux = (reg >> pingroups[i].mux_bit) & 0x3;
                        BUG_ON(pingroups[i].funcs[mux] == 0);
-                       if (pingroups[i].funcs[mux] & TEGRA_MUX_RSVD) {
+                       if (pingroups[i].funcs[mux] ==  TEGRA_MUX_INVALID) {
+                               seq_printf(s, "TEGRA_MUX_INVALID");
+                               len = 7;
+                       } else if (pingroups[i].funcs[mux] & TEGRA_MUX_RSVD) {
                                seq_printf(s, "TEGRA_MUX_RSVD%1lu", mux+1);
                                len = 5;
                        } else {