Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
i2c: mediatek: remove redundant null check
Browse files Browse the repository at this point in the history
Because clk_disable_unprepare already checked NULL clock parameter,
so the additional checks are unnecessary, just remove it

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Reviewed-by: Qii Wang <qii.wang@mediatek.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
  • Loading branch information
ISCAS-Vulab authored and wsakernel committed Mar 1, 2022
1 parent b5a796c commit 5b9df0a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/i2c/busses/i2c-mt65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,7 @@ static int mtk_i2c_clock_enable(struct mtk_i2c *i2c)
return 0;

err_arb:
if (i2c->have_pmic)
clk_disable_unprepare(i2c->clk_pmic);
clk_disable_unprepare(i2c->clk_pmic);
err_pmic:
clk_disable_unprepare(i2c->clk_main);
err_main:
Expand All @@ -488,11 +487,9 @@ static int mtk_i2c_clock_enable(struct mtk_i2c *i2c)

static void mtk_i2c_clock_disable(struct mtk_i2c *i2c)
{
if (i2c->clk_arb)
clk_disable_unprepare(i2c->clk_arb);
clk_disable_unprepare(i2c->clk_arb);

if (i2c->have_pmic)
clk_disable_unprepare(i2c->clk_pmic);
clk_disable_unprepare(i2c->clk_pmic);

clk_disable_unprepare(i2c->clk_main);
clk_disable_unprepare(i2c->clk_dma);
Expand Down

0 comments on commit 5b9df0a

Please sign in to comment.