mmc: of_mmc_spi: fix little endian support
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Mon, 30 Jan 2012 04:15:29 +0000 (05:15 +0100)
committerChris Ball <cjb@laptop.org>
Tue, 14 Feb 2012 01:38:58 +0000 (20:38 -0500)
The voltage_ranges is supposed to switch from big endian to little endian.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/of_mmc_spi.c

index ab66f2454dc48fbc5fe2d68fe51b1d2611de1f7c..1534b582c41990d0e824f705db98b2c97bfe3c83 100644 (file)
@@ -113,8 +113,8 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
                const int j = i * 2;
                u32 mask;
 
-               mask = mmc_vddrange_to_ocrmask(voltage_ranges[j],
-                                              voltage_ranges[j + 1]);
+               mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
+                                              be32_to_cpu(voltage_ranges[j + 1]));
                if (!mask) {
                        ret = -EINVAL;
                        dev_err(dev, "OF: voltage-range #%d is invalid\n", i);