[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1329350507-22528-1-git-send-email-alex@alexhornung.com>
Date: Thu, 16 Feb 2012 00:01:47 +0000
From: Alex Hornung <alex@...xhornung.com>
To: Chris Ball <cjb@...top.org>, linux-mmc@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Alex Hornung <alex@...xhornung.com>
Subject: [PATCH 1/1] mmc_spi - Fix endianess issue with voltage-ranges
* The voltage-ranges values from the device tree were used as-is,
without first (potentially) swapping the bytes to the target CPU's
endianess.
Signed-off-by: Alex Hornung <alex@...xhornung.com>
---
drivers/mmc/host/of_mmc_spi.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
index ab66f24..4bfd3e8 100644
--- a/drivers/mmc/host/of_mmc_spi.c
+++ b/drivers/mmc/host/of_mmc_spi.c
@@ -112,9 +112,10 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
for (i = 0; i < num_ranges; i++) {
const int j = i * 2;
u32 mask;
+ u32 vdd_min = be32_to_cpu(voltage_ranges[j]);
+ u32 vdd_max = be32_to_cpu(voltage_ranges[j + 1]);
- mask = mmc_vddrange_to_ocrmask(voltage_ranges[j],
- voltage_ranges[j + 1]);
+ mask = mmc_vddrange_to_ocrmask(vdd_min, vdd_max);
if (!mask) {
ret = -EINVAL;
dev_err(dev, "OF: voltage-range #%d is invalid\n", i);
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists