From patchwork Tue Jan 16 16:35:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10167615 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 451EF601E7 for ; Tue, 16 Jan 2018 16:36:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36514204C4 for ; Tue, 16 Jan 2018 16:36:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AE44204FB; Tue, 16 Jan 2018 16:36:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B7ED7204C4 for ; Tue, 16 Jan 2018 16:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Tlb2jkK/MdTliFtmoTn/YJUEq4KGmzdvWSp0KnfXrqs=; b=Q6TlN1f6Us2EUeJzCs0s5dh928 E9RZBX58KQrsEmkvl91vUkLeAyaUh6xVxFNxnr4v+l7HXgCC2pCncuYKgEaWBZ26YTzFmKqCdtgPq Rc2KmhsDPOY3rf5ezwB9o2WTDVRvuh43bVSgDWY9gIdW+om4K0TvL2TmCfkTblcLoqe0sTAx8HaTz wxJwMv49DkrDcKVbdvPeC3qYZRhZADwdHyMJTyFLgvDRQLU5jkYOVBFa7G7Ear5Q6Whi13VOngUv+ YF7oxad1odDEoTUdfvLZ1RJZQ4IqFk2DKqwZtsK7/6WQetZTCRN9P9C/4YG9NPUk6TL2mkXPtRtbT 3RhNe3kg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ebUE8-0000hs-LM; Tue, 16 Jan 2018 16:36:44 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ebUDU-0007Qz-UH for linux-arm-kernel@lists.infradead.org; Tue, 16 Jan 2018 16:36:08 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 56410208D1; Tue, 16 Jan 2018 17:35:53 +0100 (CET) Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.free-electrons.com (Postfix) with ESMTPSA id 29F3E208C1; Tue, 16 Jan 2018 17:35:43 +0100 (CET) From: Gregory CLEMENT To: Wolfram Sang , linux-i2c@vger.kernel.org Subject: [PATCH v4 1/3] i2c: mv64xxx: Remove useless test before clk_disable_unprepare Date: Tue, 16 Jan 2018 17:35:38 +0100 Message-Id: <20180116163540.1092-2-gregory.clement@free-electrons.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180116163540.1092-1-gregory.clement@free-electrons.com> References: <20180116163540.1092-1-gregory.clement@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180116_083605_191206_2433039A X-CRM114-Status: GOOD ( 10.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Andrew Lunn , Jason Cooper , Antoine Tenart , Omri Itach , Nadav Haklai , Shadi Ammouri , Igal Liberman , =?UTF-8?q?Miqu=C3=A8l=20Raynal?= , Gregory CLEMENT , Marcin Wojtas , Hanna Hawa , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The 2 functions called from clk_disable_unprepare() already check that the clock pointer is valid: no need to test it before calling it. Signed-off-by: Gregory CLEMENT --- drivers/i2c/busses/i2c-mv64xxx.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index a832c45276a4..f69066266faa 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c @@ -950,9 +950,7 @@ mv64xxx_i2c_probe(struct platform_device *pd) exit_reset: reset_control_assert(drv_data->rstc); exit_clk: - /* Not all platforms have a clk */ - if (!IS_ERR(drv_data->clk)) - clk_disable_unprepare(drv_data->clk); + clk_disable_unprepare(drv_data->clk); return rc; } @@ -965,9 +963,7 @@ mv64xxx_i2c_remove(struct platform_device *dev) i2c_del_adapter(&drv_data->adapter); free_irq(drv_data->irq, drv_data); reset_control_assert(drv_data->rstc); - /* Not all platforms have a clk */ - if (!IS_ERR(drv_data->clk)) - clk_disable_unprepare(drv_data->clk); + clk_disable_unprepare(drv_data->clk); return 0; }