From: Philippe Mathieu-Daudé Date: Mon, 17 Jun 2024 11:03:56 +0000 (+0200) Subject: hw/sd/sdcard: Use registerfield CSR::CURRENT_STATE definition X-Git-Tag: qemu-xen-4.20.0~101^2~12 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=904547845c559d7530a20792d599a77d8e2ae442;p=qemu-xen.git hw/sd/sdcard: Use registerfield CSR::CURRENT_STATE definition Use registerfield-generated definitions to update card_status. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Message-Id: <20240621080554.18986-6-philmd@linaro.org> --- diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a14c5ff147..64270dec0f 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1788,8 +1788,8 @@ int sd_do_command(SDState *sd, SDRequest *req, * (Do this now so they appear in r1 responses.) */ sd->current_cmd = req->cmd; - sd->card_status &= ~CURRENT_STATE; - sd->card_status |= (last_state << 9); + sd->card_status = FIELD_DP32(sd->card_status, CSR, + CURRENT_STATE, last_state); } send_response: