Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4401203pxk; Wed, 30 Sep 2020 01:45:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ2c1WQEG5Fmq+FuEyIzVfiu6I7oEy03l/+1oCMdMBHIyY2A2g5PrJxDFpMf+NDz7uwYrF X-Received: by 2002:a17:906:5812:: with SMTP id m18mr1819554ejq.204.1601455544584; Wed, 30 Sep 2020 01:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601455544; cv=none; d=google.com; s=arc-20160816; b=Sq1ou10ILEfH/mrO5A25Bh+LkD771xYNBXcC/5/hoCJnT3jlB4SR2SH7j+pKCAKZBI qbr4ubZ7DV3DlR1it28RC8vEh8qU5+GClvxNFneMUuSBcEQk+hz4DiItjRQZvNGYyhlr gCVEmzRtiqJz+kaxo3m3khlRD2ykRc9NEMj7jYedHO2ANFUyl5zAXiM4VBiGvjnwW2hU XHFfMJwiHMUl8umjwsF4EprIMXlBD4qrp2M7SSvliJIUA+o6V433gTxfACDLCrhV2K8+ I5iaO1gPGjzH4EkErRJjyS8P98kJOU09aonyI5TT5XyHZdqm9pakBhJb2WEWUFwmJPON MOfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=2sJDKhYTNpLLS8HDaUWK6h1o0l7MDgCBLvsPVhzZLJg=; b=ap3F39cROS5frc/e95DeNQ+RwgKypM8cerbDTFsoqLA4rAWAa/zbWct/AWYfykCvJL LdNyakTh7dKvqQXsElXsm8RpubB1yHfer1wf9GBou0vUj+zndfHMjHkrl6DAp3CTtrdB Vll0eXshZYbAqAKs+ChUb2X/EVUxXXCy1jAethjkjy7bnzU/Sy6ER6HJZqANrwXA7sHn YukScdYZp/74rlnzRCBhchrdCFFKpAIQhS4u26p2nDaI+Ma+ebOupDZWF91Z6B3fj8Hm oes4sN8fhVlrJt9T5pf2nnpEdu4nNYbzloVJYjfepWOSB5lCLjcBOlaUgRzxwA1cmaT7 YWyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si583453edt.19.2020.09.30.01.45.21; Wed, 30 Sep 2020 01:45:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728547AbgI3Ims (ORCPT + 99 others); Wed, 30 Sep 2020 04:42:48 -0400 Received: from smtp23.cstnet.cn ([159.226.251.23]:48656 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725535AbgI3Ims (ORCPT ); Wed, 30 Sep 2020 04:42:48 -0400 Received: from localhost.localdomain (unknown [159.226.5.100]) by APP-03 (Coremail) with SMTP id rQCowAB3L1z7RHRfZnOjAA--.46271S2; Wed, 30 Sep 2020 16:42:36 +0800 (CST) From: Xu Wang To: qii.wang@mediatek.com, matthias.bgg@gmail.com Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] i2c: mediatek: remove redundant null check Date: Wed, 30 Sep 2020 08:42:33 +0000 Message-Id: <20200930084233.53085-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: rQCowAB3L1z7RHRfZnOjAA--.46271S2 X-Coremail-Antispam: 1UD129KBjvJXoW7JF4UZF47GFy5Wr1DWF4fGrg_yoW8JrW8pF WxGr9Yyr47XFWj9F1DXw4q9ry5ta13GF9agr45Ga4fWr45tr1vvFW5Ka4DZF1IyrWxtw17 Xr1DKrnrGFyjk3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUySb7Iv0xC_KF4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jrv_JF1lYx0Ex4A2jsIE14v26r4j6F4UMc vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwIxGrwCFx2Iq xVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r 106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AK xVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7 xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_ Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jw2-5UUUUU= X-Originating-IP: [159.226.5.100] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCAsPA18J9rWkNgAAsI Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Because clk_disable_unprepare already checked NULL clock parameter, so the additional checks are unnecessary, just remove it Signed-off-by: Xu Wang --- drivers/i2c/busses/i2c-mt65xx.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index 0cbdfbe605b5..48d37de827e1 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -449,8 +449,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: @@ -461,11 +460,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); -- 2.17.1