summaryrefslogtreecommitdiffstats
path: root/drivers/soc/mediatek
diff options
context:
space:
mode:
authorBibby Hsieh <bibby.hsieh@mediatek.com>2019-11-21 02:54:06 +0100
committerMatthias Brugger <matthias.bgg@gmail.com>2020-01-08 12:59:41 +0100
commit01d1b408ecb0fe277358ba006e569d87ef2a3a45 (patch)
treea297c4f5ee80e165a5d81ffd5b080bfb192fd364 /drivers/soc/mediatek
parentLinux 5.5-rc1 (diff)
downloadlinux-01d1b408ecb0fe277358ba006e569d87ef2a3a45.tar.xz
linux-01d1b408ecb0fe277358ba006e569d87ef2a3a45.zip
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: Bibby Hsieh <bibby.hsieh@mediatek.com> Reviewed-by: CK Hu <ck.hu@mediatek.com> [mb: rephrase commit message] Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Diffstat (limited to 'drivers/soc/mediatek')
-rw-r--r--drivers/soc/mediatek/mtk-cmdq-helper.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c
index 3c82de5f9417..c8fb69787649 100644
--- a/drivers/soc/mediatek/mtk-cmdq-helper.c
+++ b/drivers/soc/mediatek/mtk-cmdq-helper.c
@@ -149,13 +149,16 @@ int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys,
u16 offset, u32 value, u32 mask)
{
u32 offset_mask = offset;
- int err = 0;
+ int err;
if (mask != 0xffffffff) {
err = cmdq_pkt_append_command(pkt, CMDQ_CODE_MASK, 0, ~mask);
+ if (err < 0)
+ return err;
+
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;
}
@@ -197,9 +200,11 @@ static int cmdq_pkt_finalize(struct cmdq_pkt *pkt)
/* insert EOC and generate IRQ for each command iteration */
err = cmdq_pkt_append_command(pkt, CMDQ_CODE_EOC, 0, CMDQ_EOC_IRQ_EN);
+ if (err < 0)
+ return err;
/* 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;
}