mmc: sanitize 'bus width' in debug output
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 29 Jan 2016 08:27:50 +0000 (09:27 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 29 Feb 2016 10:02:56 +0000 (11:02 +0100)
The bus width is sometimes the actual bus width, and sometimes indices
to different arrays encoding the bus width. In my debugging case "2"
could mean 8-bit as well as 4-bit, which was extremly confusing. Let's
use the human-readable actual bus width in all places.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/core.c
drivers/mmc/core/mmc.c

index 9da9b604b1c1ec83d1205a6891c0bee76d7052d6..abd3212154d4747defe2d3ae66ca5c2ebcd0e599 100644 (file)
@@ -1033,7 +1033,7 @@ static inline void mmc_set_ios(struct mmc_host *host)
                "width %u timing %u\n",
                 mmc_hostname(host), ios->clock, ios->bus_mode,
                 ios->power_mode, ios->chip_select, ios->vdd,
-                ios->bus_width, ios->timing);
+                1 << ios->bus_width, ios->timing);
 
        host->ops->set_ios(host, ios);
 }
index 07a135bc893057670ff3d9b32db61e6617bf289c..4dbe3df8024b2cf3ed9206f8d76cff1ba660dc7e 100644 (file)
@@ -945,7 +945,7 @@ static int mmc_select_bus_width(struct mmc_card *card)
                        break;
                } else {
                        pr_warn("%s: switch to bus width %d failed\n",
-                               mmc_hostname(host), ext_csd_bits[idx]);
+                               mmc_hostname(host), 1 << bus_width);
                }
        }