mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
hw/sd/sdcard: Rewrite sd_cmd_ALL_SEND_CID using switch case (CMD2)
Keep this handler style in sync with other handlers by using a switch() case, which might become handy to handle other states. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Cédric Le Goater <clg@redhat.com> Tested-by: Cédric Le Goater <clg@redhat.com> Message-Id: <20240621080554.18986-3-philmd@linaro.org>
This commit is contained in:
parent
8d380565ad
commit
d00e614f61
1 changed files with 5 additions and 5 deletions
10
hw/sd/sd.c
10
hw/sd/sd.c
|
@ -1044,13 +1044,13 @@ static sd_rsp_type_t sd_cmd_SEND_OP_CMD(SDState *sd, SDRequest req)
|
||||||
|
|
||||||
static sd_rsp_type_t sd_cmd_ALL_SEND_CID(SDState *sd, SDRequest req)
|
static sd_rsp_type_t sd_cmd_ALL_SEND_CID(SDState *sd, SDRequest req)
|
||||||
{
|
{
|
||||||
if (sd->state != sd_ready_state) {
|
switch (sd->state) {
|
||||||
|
case sd_ready_state:
|
||||||
|
sd->state = sd_identification_state;
|
||||||
|
return sd_r2_i;
|
||||||
|
default:
|
||||||
return sd_invalid_state_for_cmd(sd, req);
|
return sd_invalid_state_for_cmd(sd, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
sd->state = sd_identification_state;
|
|
||||||
|
|
||||||
return sd_r2_i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static sd_rsp_type_t sd_cmd_SEND_RELATIVE_ADDR(SDState *sd, SDRequest req)
|
static sd_rsp_type_t sd_cmd_SEND_RELATIVE_ADDR(SDState *sd, SDRequest req)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue