Commit 01d1b408 authored by Bibby Hsieh's avatar Bibby Hsieh Committed by Matthias Brugger

soc: mediatek: cmdq: remove OR opertaion from err return

Debugging gets harder if we OR two error return values.
Return each error on it's own instead
Signed-off-by: default avatarBibby Hsieh <bibby.hsieh@mediatek.com>
Reviewed-by: default avatarCK Hu <ck.hu@mediatek.com>
[mb: rephrase commit message]
Signed-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
parent e42617b8
...@@ -149,13 +149,16 @@ int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys, ...@@ -149,13 +149,16 @@ int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys,
u16 offset, u32 value, u32 mask) u16 offset, u32 value, u32 mask)
{ {
u32 offset_mask = offset; u32 offset_mask = offset;
int err = 0; int err;
if (mask != 0xffffffff) { if (mask != 0xffffffff) {
err = cmdq_pkt_append_command(pkt, CMDQ_CODE_MASK, 0, ~mask); err = cmdq_pkt_append_command(pkt, CMDQ_CODE_MASK, 0, ~mask);
if (err < 0)
return err;
offset_mask |= CMDQ_WRITE_ENABLE_MASK; offset_mask |= CMDQ_WRITE_ENABLE_MASK;
} }
err |= cmdq_pkt_write(pkt, subsys, offset_mask, value); err = cmdq_pkt_write(pkt, subsys, offset_mask, value);
return err; return err;
} }
...@@ -197,9 +200,11 @@ static int cmdq_pkt_finalize(struct cmdq_pkt *pkt) ...@@ -197,9 +200,11 @@ static int cmdq_pkt_finalize(struct cmdq_pkt *pkt)
/* insert EOC and generate IRQ for each command iteration */ /* insert EOC and generate IRQ for each command iteration */
err = cmdq_pkt_append_command(pkt, CMDQ_CODE_EOC, 0, CMDQ_EOC_IRQ_EN); err = cmdq_pkt_append_command(pkt, CMDQ_CODE_EOC, 0, CMDQ_EOC_IRQ_EN);
if (err < 0)
return err;
/* JUMP to end */ /* JUMP to end */
err |= cmdq_pkt_append_command(pkt, CMDQ_CODE_JUMP, 0, CMDQ_JUMP_PASS); err = cmdq_pkt_append_command(pkt, CMDQ_CODE_JUMP, 0, CMDQ_JUMP_PASS);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment