diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-27 10:12:39 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-27 10:12:39 -0700 |
| commit | 3d1343b55643d60839d711205076e75754e9126e (patch) | |
| tree | 72db9f362ee10c050abe07fc1910775f9b280de0 /drivers/mmc/core | |
| parent | a2508c0814c6d2c0259fa859a6184343b1e39ea3 (diff) | |
| parent | 460cd0589df8aa9b89599905b13c2010db627012 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
mmc_spi: Fix mmc-over-spi regression
mmc: use common byte swap macros
mmc: fix cid and csd byte order
at91_mci: Fix bad reference
Diffstat (limited to 'drivers/mmc/core')
| -rw-r--r-- | drivers/mmc/core/mmc_ops.c | 22 | ||||
| -rw-r--r-- | drivers/mmc/core/sd_ops.c | 4 |
2 files changed, 22 insertions, 4 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index bf4bc6adcfe..7471d49909b 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -267,15 +267,26 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, int mmc_send_csd(struct mmc_card *card, u32 *csd) { + int ret, i; + if (!mmc_host_is_spi(card->host)) return mmc_send_cxd_native(card->host, card->rca << 16, csd, MMC_SEND_CSD); - return mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd, 16); + ret = mmc_send_cxd_data(card, card->host, MMC_SEND_CSD, csd, 16); + if (ret) + return ret; + + for (i = 0;i < 4;i++) + csd[i] = be32_to_cpu(csd[i]); + + return 0; } int mmc_send_cid(struct mmc_host *host, u32 *cid) { + int ret, i; + if (!mmc_host_is_spi(host)) { if (!host->card) return -EINVAL; @@ -283,7 +294,14 @@ int mmc_send_cid(struct mmc_host *host, u32 *cid) cid, MMC_SEND_CID); } - return mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid, 16); + ret = mmc_send_cxd_data(NULL, host, MMC_SEND_CID, cid, 16); + if (ret) + return ret; + + for (i = 0;i < 4;i++) + cid[i] = be32_to_cpu(cid[i]); + + return 0; } int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd) diff --git a/drivers/mmc/core/sd_ops.c b/drivers/mmc/core/sd_ops.c index ee4029a24ef..a6dafe62b99 100644 --- a/drivers/mmc/core/sd_ops.c +++ b/drivers/mmc/core/sd_ops.c @@ -294,8 +294,8 @@ int mmc_app_send_scr(struct mmc_card *card, u32 *scr) if (data.error) return data.error; - scr[0] = ntohl(scr[0]); - scr[1] = ntohl(scr[1]); + scr[0] = be32_to_cpu(scr[0]); + scr[1] = be32_to_cpu(scr[1]); return 0; } |
