From patchwork Tue Mar 28 09:17:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 96124 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1615084qgd; Tue, 28 Mar 2017 02:19:27 -0700 (PDT) X-Received: by 10.84.218.138 with SMTP id r10mr34913970pli.165.1490692767126; Tue, 28 Mar 2017 02:19:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14si3617619pga.80.2017.03.28.02.19.26; Tue, 28 Mar 2017 02:19:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755149AbdC1JT0 (ORCPT + 18 others); Tue, 28 Mar 2017 05:19:26 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:28810 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754644AbdC1JTZ (ORCPT ); Tue, 28 Mar 2017 05:19:25 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id v2S9Hu2s004893; Tue, 28 Mar 2017 18:17:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com v2S9Hu2s004893 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490692680; bh=fK2RJ1Da3hy3TqxcuRfSuQg1emV4XOrvH53yoXtQ+zA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Og07Z2YkQVYyN5tqxYr8rPRKFRxRtpaOatgWZmQWXjzLSCCKNmECQLGpjb0Bsg/iM D1UeqctP2Nku0/22UhFgIsSNNJz3mMB/eyUKE4Z3kdJJXrLbjJm393AfwPw0PE/SJV F9IK2sKhcSVf9wARLhMkwsg0Lpl1eIcwxdT7UkCIRAx5y8W5uELU/1jEgjwaTHz9su U8bZtMBGQRGg31ZKLqNqv0JT3hRIij/t7ZykV9v0efkKj8OyN7j1IrhFk2LGgCOAP/ 2sY6tuSaY0ya9riinQih4icn8fIKSQZUhlI0CYXIWGjdE3N0MlBNFdShxrYYigMo9Y sBrwUSXx+o3tg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Cc: Stephen Boyd , Ralf Baechle , Michael Turquette , Masahiro Yamada , Steven Miao , adi-buildroot-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v5 3/3] blackfin: bf609: let clk_disable() return immediately if clk is NULL Date: Tue, 28 Mar 2017 18:17:04 +0900 Message-Id: <1490692624-11931-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> References: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In many of clk_disable() implementations, it is a no-op for a NULL pointer input, but this is one of the exceptions. Making it treewide consistent will allow clock consumers to call clk_disable() without NULL pointer check. Signed-off-by: Masahiro Yamada --- Changes in v5: None Changes in v4: - Split into per-arch patches Changes in v3: - Return only when clk is NULL. Do not take care of error pointer. Changes in v2: - Rebase on Linux 4.6-rc1 arch/blackfin/mach-bf609/clock.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 diff --git a/arch/blackfin/mach-bf609/clock.c b/arch/blackfin/mach-bf609/clock.c index 3783058..392a59b 100644 --- a/arch/blackfin/mach-bf609/clock.c +++ b/arch/blackfin/mach-bf609/clock.c @@ -97,6 +97,9 @@ EXPORT_SYMBOL(clk_enable); void clk_disable(struct clk *clk) { + if (!clk) + return; + if (clk->ops && clk->ops->disable) clk->ops->disable(clk); }