aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorXu Wang2020-09-30 08:42:33 +0000
committerWolfram Sang2022-03-01 16:22:23 +0100
commit5b9df0acd22a0bcd4e0e97e6f8368c31843ceb95 (patch)
treea3da0d1ca8e3bf9bb641a16ebc2c51af91f3e9f4 /drivers/i2c
parentb5a796c6a8091b636f12cd9df12ccb2eed1b7f6c (diff)
i2c: mediatek: remove redundant null check
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-mt65xx.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index 682293ec9825..5bf7f965800d 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -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:
@@ -488,11 +487,9 @@ err_main:
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);