Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757646AbcDHAdj (ORCPT ); Thu, 7 Apr 2016 20:33:39 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47761 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530AbcDHAdc (ORCPT ); Thu, 7 Apr 2016 20:33:32 -0400 Date: Thu, 7 Apr 2016 17:33:28 -0700 From: Stephen Boyd To: Masahiro Yamada Cc: linux-clk@vger.kernel.org, Ralf Baechle , Michael Turquette , linux-mips@linux-mips.org, linux-sh@vger.kernel.org, Haojian Zhuang , Eric Miao , Hartley Sweeten , Greg Ungerer , Ryan Mallon , Geert Uytterhoeven , Steven Miao , Simon Horman , Wan ZongShun , Rich Felker , Yoshinori Sato , adi-buildroot-devel@lists.sourceforge.net, Russell King , linux-m68k@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Magnus Damm , John Crispin Subject: Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error Message-ID: <20160408003328.GA14441@codeaurora.org> References: <1459821083-28116-1-git-send-email-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1459821083-28116-1-git-send-email-yamada.masahiro@socionext.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1269 Lines: 32 On 04/05, Masahiro Yamada wrote: > The clk_disable() in the common clock framework (drivers/clk/clk.c) > returns immediately if a given clk is NULL or an error pointer. It > allows clock consumers to call clk_disable() without IS_ERR_OR_NULL > checking if drivers are only used with the common clock framework. > > Unfortunately, NULL/error checking is missing from some of non-common > clk_disable() implementations. This prevents us from completely > dropping NULL/error checking from callers. Let's make it tree-wide > consistent by adding IS_ERR_OR_NULL(clk) to all callees. > > Signed-off-by: Masahiro Yamada > Acked-by: Greg Ungerer > Acked-by: Wan Zongshun > --- > > Stephen, > > This patch has been unapplied for a long time. > > Please let me know if there is something wrong with this patch. > I'm mostly confused why we wouldn't want to encourage people to call clk_disable or unprepare on a clk that's an error pointer. Typically an error pointer should be dealt with, instead of silently ignored, so why wasn't it dealt with by passing it up the probe() path? -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project