aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-12-18 21:37:54 +0100
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>2011-12-21 05:01:27 +0100
commite30d59388bab90418b414c1f29d5779361d31ffe (patch)
tree4814302c3018bb449316d5eae0cd7cf3c2abbb93 /hw
parentabda1f37eed86f3501db2e5439c1a7b97171ea22 (diff)
hw/sd.c: When setting ADDRESS_ERROR bit, don't clear everything else
Fix a typo that meant that ADDRESS_ERRORs setting or clearing write protection would clear every other bit in the status register. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/sd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/sd.c b/hw/sd.c
index e57852e19d..dd280610f2 100644
--- a/hw/sd.c
+++ b/hw/sd.c
@@ -999,7 +999,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd,
switch (sd->state) {
case sd_transfer_state:
if (addr >= sd->size) {
- sd->card_status = ADDRESS_ERROR;
+ sd->card_status |= ADDRESS_ERROR;
return sd_r1b;
}
@@ -1019,7 +1019,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd,
switch (sd->state) {
case sd_transfer_state:
if (addr >= sd->size) {
- sd->card_status = ADDRESS_ERROR;
+ sd->card_status |= ADDRESS_ERROR;
return sd_r1b;
}