summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/amd/common/block/psp/psp_gen2.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/soc/amd/common/block/psp/psp_gen2.c b/src/soc/amd/common/block/psp/psp_gen2.c
index cbae7a5f5f..22e19fa4ef 100644
--- a/src/soc/amd/common/block/psp/psp_gen2.c
+++ b/src/soc/amd/common/block/psp/psp_gen2.c
@@ -46,10 +46,7 @@ static void *soc_get_mbox_address(void)
static u16 rd_mbox_sts(struct pspv2_mbox *mbox)
{
- union {
- u32 val;
- struct pspv2_mbox_cmd_fields fields;
- } tmp = { 0 };
+ union pspv2_mbox_command tmp = { .val = 0 };
tmp.val = read32(&mbox->command);
return tmp.fields.mbox_status;
@@ -57,10 +54,7 @@ static u16 rd_mbox_sts(struct pspv2_mbox *mbox)
static void wr_mbox_cmd(struct pspv2_mbox *mbox, u8 cmd)
{
- union {
- u32 val;
- struct pspv2_mbox_cmd_fields fields;
- } tmp = { 0 };
+ union pspv2_mbox_command tmp = { .val = 0 };
/* Write entire 32-bit area to begin command execution */
tmp.fields.mbox_command = cmd;
@@ -69,10 +63,7 @@ static void wr_mbox_cmd(struct pspv2_mbox *mbox, u8 cmd)
static u8 rd_mbox_recovery(struct pspv2_mbox *mbox)
{
- union {
- u32 val;
- struct pspv2_mbox_cmd_fields fields;
- } tmp = { 0 };
+ union pspv2_mbox_command tmp = { .val = 0 };
tmp.val = read32(&mbox->command);
return !!tmp.fields.recovery;