From patchwork Sun Dec 18 20:37:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 5840 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 231B923E2D for ; Sun, 18 Dec 2011 20:38:07 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 14704A18281 for ; Sun, 18 Dec 2011 20:38:07 +0000 (UTC) Received: by mail-ey0-f180.google.com with SMTP id c11so1269913eaa.11 for ; Sun, 18 Dec 2011 12:38:07 -0800 (PST) Received: by 10.204.136.194 with SMTP id s2mr750485bkt.96.1324240686879; Sun, 18 Dec 2011 12:38:06 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.204.40.4 with SMTP id i4cs108680bke; Sun, 18 Dec 2011 12:38:06 -0800 (PST) Received: by 10.236.128.242 with SMTP id f78mr10992883yhi.7.1324240684244; Sun, 18 Dec 2011 12:38:04 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id v10si15683730yhi.126.2011.12.18.12.38.03 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Dec 2011 12:38:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1RcNUe-00070W-OX; Sun, 18 Dec 2011 20:38:00 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 04/10] hw/sd.c: When setting ADDRESS_ERROR bit, don't clear everything else Date: Sun, 18 Dec 2011 20:37:54 +0000 Message-Id: <1324240680-26905-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1324240680-26905-1-git-send-email-peter.maydell@linaro.org> References: <1324240680-26905-1-git-send-email-peter.maydell@linaro.org> 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 --- hw/sd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index e57852e..dd28061 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; }