Skip to contentSkip to conversation

of_mmc_spi: fix little endian support

PATCH New Jean-Christophe PLAGNIOL-VILLARD 3 participants 4 messages Jan 30, 2012 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of_mmc_spi: fix little endian support

the voltage_ranges is supposed to switch from big endian to little endian

Cc Grant Likely <[email protected]>
Cc linux-mmc at vger.kernel.org
---
 drivers/mmc/host/of_mmc_spi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/host/of_mmc_spi.c +3 -2
index ab66f24..ede2c64 100644
@@ -109,12 +109,13 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
 		goto err_ocr;
 	}
 
+
 	for (i = 0; i < num_ranges; i++) {
 		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);
Signature · 1 line
1.7.7
Applied
#1 lore raw

PATCH 1/1 of_mmc_spi: fix little endian support

Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD

the voltage_ranges is supposed to switch from big endian to little endian

Cc Grant Likely <[email protected]>
Cc linux-mmc at vger.kernel.org

Applied, thanks.

g.

Quoted 27 lines
---
 drivers/mmc/host/of_mmc_spi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/host/of_mmc_spi.c +3 -2
index ab66f24..ede2c64 100644
@@ -109,12 +109,13 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
 		goto err_ocr;
 	}
 
+
 	for (i = 0; i < num_ranges; i++) {
 		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);
Signature · 1 line
1.7.7
#2 lore raw

PATCH 1/1 of_mmc_spi: fix little endian support

Quoted 8 lines · Grant Likely
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD

the voltage_ranges is supposed to switch from big endian to little endian

Cc Grant Likely <[email protected]>
Cc linux-mmc at vger.kernel.org

Applied, thanks.

Actually, this one should go via Chris' tree since it is part of drivers/mmc. So I've dropped it from my tree and change that s-o-b of mine to an a-b.

g.

#3 lore raw

PATCH 1/1 of_mmc_spi: fix little endian support

Hi,

Quoted 9 lines · Grant Likely
Quoted 8 lines · Grant Likely
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD

the voltage_ranges is supposed to switch from big endian to little endian

Cc Grant Likely <[email protected]>
Cc linux-mmc at vger.kernel.org
Quoted 5 lines
Quoted 1 line

Applied, thanks.

Actually, this one should go via Chris' tree since it is part of drivers/mmc. So I've dropped it from my tree and change that s-o-b of mine to an a-b.

Thanks, done that, and removed the extra/incorrect punctuation change from the patch.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child