All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mmc_spi - Fix endianess issue with voltage-ranges
@ 2012-02-16  0:01 Alex Hornung
  0 siblings, 0 replies; only message in thread
From: Alex Hornung @ 2012-02-16  0:01 UTC (permalink / raw)
  To: Chris Ball, linux-mmc; +Cc: linux-kernel, Alex Hornung

 * 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@alexhornung.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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-16  0:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16  0:01 [PATCH 1/1] mmc_spi - Fix endianess issue with voltage-ranges Alex Hornung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.