diff options
author | Jayachandran C. <jchandra@FreeBSD.org> | 2011-05-30 06:23:51 +0000 |
---|---|---|
committer | Jayachandran C. <jchandra@FreeBSD.org> | 2011-05-30 06:23:51 +0000 |
commit | bcd91d25daaf08ef7c5987f3ec86eb0b28daf191 (patch) | |
tree | b59618edfa1e2aca4e43a08e1267750f30b498ad /sys/dev/sdhci | |
parent | d832ded1a1c0add4a11f49c5808aff69f8145693 (diff) | |
download | src-bcd91d25daaf08ef7c5987f3ec86eb0b28daf191.tar.gz src-bcd91d25daaf08ef7c5987f3ec86eb0b28daf191.zip |
Fix read_ivar implementation for MMC and SD.
1. Both mmc_read_ivar() and sdhci_read_ivar() use the expression
'*(int *)result = val' to assign to result which is uintptr_t *.
This does not work on big-endian 64 bit systems.
2. The media_size ivar is declared as 'off_t' which does not fit
into uintptr_t in 32bit systems, change this to long.
Submitted by: kanthms at netlogicmicro com (initial version)
Notes
Notes:
svn path=/head/; revision=222475
Diffstat (limited to 'sys/dev/sdhci')
-rw-r--r-- | sys/dev/sdhci/sdhci.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 6bbc25f50b4e..24cba57f4c5b 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -1443,46 +1443,46 @@ sdhci_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) default: return (EINVAL); case MMCBR_IVAR_BUS_MODE: - *(int *)result = slot->host.ios.bus_mode; + *result = slot->host.ios.bus_mode; break; case MMCBR_IVAR_BUS_WIDTH: - *(int *)result = slot->host.ios.bus_width; + *result = slot->host.ios.bus_width; break; case MMCBR_IVAR_CHIP_SELECT: - *(int *)result = slot->host.ios.chip_select; + *result = slot->host.ios.chip_select; break; case MMCBR_IVAR_CLOCK: - *(int *)result = slot->host.ios.clock; + *result = slot->host.ios.clock; break; case MMCBR_IVAR_F_MIN: - *(int *)result = slot->host.f_min; + *result = slot->host.f_min; break; case MMCBR_IVAR_F_MAX: - *(int *)result = slot->host.f_max; + *result = slot->host.f_max; break; case MMCBR_IVAR_HOST_OCR: - *(int *)result = slot->host.host_ocr; + *result = slot->host.host_ocr; break; case MMCBR_IVAR_MODE: - *(int *)result = slot->host.mode; + *result = slot->host.mode; break; case MMCBR_IVAR_OCR: - *(int *)result = slot->host.ocr; + *result = slot->host.ocr; break; case MMCBR_IVAR_POWER_MODE: - *(int *)result = slot->host.ios.power_mode; + *result = slot->host.ios.power_mode; break; case MMCBR_IVAR_VDD: - *(int *)result = slot->host.ios.vdd; + *result = slot->host.ios.vdd; break; case MMCBR_IVAR_CAPS: - *(int *)result = slot->host.caps; + *result = slot->host.caps; break; case MMCBR_IVAR_TIMING: - *(int *)result = slot->host.ios.timing; + *result = slot->host.ios.timing; break; case MMCBR_IVAR_MAX_DATA: - *(int *)result = 65535; + *result = 65535; break; } return (0); |