Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp575250imu; Fri, 16 Nov 2018 07:02:05 -0800 (PST) X-Google-Smtp-Source: AJdET5f8WOSUAlG5wCuEHcCSa31BCaBEWP5j/oStxVbdm5AmF7AXt0KDg6H4azGCU8zI57uSRpBe X-Received: by 2002:a63:a552:: with SMTP id r18mr10298600pgu.176.1542380525103; Fri, 16 Nov 2018 07:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542380525; cv=none; d=google.com; s=arc-20160816; b=c/0Ks4GJ5UtK5vrUc4r2WlQmL1NudKsVy6hZV2cUUrwcu8sVXLJR79G6zOANNng5WH UirYMG3WQCHtVyRc0PP81+lxq0HdAUQIQ+4woxK9Y9VioItoF6EIeg0iidRXNYBSW0Mr ZT0cOFBro7IuDzzteeBEUW8J+GRBk9lnqPbF8xEsP63Wtpl0H7cwEvVF571dZbWos2IR Hi94IX9beqPlh6CFBTb2wlkT9cSLsn1826wzr7lK67LhTC3T1WJQtEC/3awgk0NclhYM dT+5ow3uvAyV/mPaFuwaNGSlwaQ1USoGw1XMXVWpCrbITCuOQZWx7f6Ibglz3tA8kxOl 7WoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Y3Naciw1bRSHKjUsFpZCg3Gta+6yr+gvDIsjUnK4Ycs=; b=MeUQPgT5lQrekStKQDEPocLO5ioYUZlw5BBGzyHbNZytXZV/2Li1pNzrCIsqkYsNrl WauL407/t3EiDcEoFtytZGNJo2ghxKbCs3LKbduK5Cbtz4N2RZdy+stcWJRrfYIfDwuY zIZ+Ticre4tTOM78xHydSq+cMWo0Q7WVvJx4ZpgBy4bvEZ74t1fPPD60ljVbdqzaYdsA Z0gFncgJN21iNcZVtuIPEIS6Q3Lzgvc+7LYlcGhNrLs8gIjVFuAcHiQj8Dc1l88sOdCA n5No/69X9gV2s0kQxSrCmR2/zf2iFEv2rIke/P1sHLQEblYFJmqe6+Yd3jWjJSxKU9sn Z9rA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q18si13562326pls.30.2018.11.16.07.01.50; Fri, 16 Nov 2018 07:02:05 -0800 (PST) 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; 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 S1728614AbeKQBMg (ORCPT + 99 others); Fri, 16 Nov 2018 20:12:36 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:5643 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728079AbeKQBMf (ORCPT ); Fri, 16 Nov 2018 20:12:35 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie6.idc.renesas.com with ESMTP; 16 Nov 2018 23:59:50 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id B6F9C10021F; Fri, 16 Nov 2018 23:59:50 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.56,240,1539615600"; d="scan'208";a="297674423" Received: from unknown (HELO vbox.ree.adwin.renesas.com) ([10.226.37.67]) by relmlii2.idc.renesas.com with ESMTP; 16 Nov 2018 23:59:45 +0900 From: Phil Edworthy To: Stephen Boyd , Michael Turquette , Andy Shevchenko , Russell King , Greg Ungerer , Geert Uytterhoeven , Ralf Baechle , Paul Burton , James Hogan , Jiaxun Yang , Huacai Chen , Guan Xuetao Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Phil Edworthy , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-m68k@lists.linux-m68k.org, linux-mips@linux-mips.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 0/6] clk: Add functions to get optional clocks Date: Fri, 16 Nov 2018 14:59:31 +0000 Message-Id: <20181116145937.27660-1-phil.edworthy@renesas.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quite a few drivers get an optional clock, e.g. a bus clock required to access peripheral's registers that is always enabled on some devices. This series adds of_clk_get_by_name_optional(), clk_get_optional() and devm_clk_get_optional() functions for this purpose. The functions behave the same as of_clk_get_by_name(), clk_get() and devm_clk_get() except that they will return NULL instead of -ENOENT. This allows for simpler error handling in the callers. *Note* This changes the return values for of_clk_get_by_name() in some cases, see [PATCH 1/6] clk: Add of_clk_get_by_name_optional() function. v6: - Rework the __of_clk_get_by_name() logic so as to avoid duplicate tests. - Add doxygen style comment for devm_clk_get_optional() args - Add clk_get_optional() to archs that don't use the commom clk framework. Phil Edworthy (6): clk: Add of_clk_get_by_name_optional() function clk: Add functions to get optional clocks m68k: coldfire: Add clk_get_optional() function MIPS: AR7: Add clk_get_optional() function MIPS: Loongson 2F: Add clk_get_optional() function arch/unicore32/kernel/clock.c: Add clk_get_optional() function arch/m68k/coldfire/clk.c | 11 ++++ arch/mips/ar7/clock.c | 11 ++++ arch/mips/loongson64/lemote-2f/clock.c | 11 ++++ arch/unicore32/kernel/clock.c | 11 ++++ drivers/clk/clk-devres.c | 18 ++++- drivers/clk/clkdev.c | 91 ++++++++++++++++++++++---- include/linux/clk.h | 38 +++++++++++ 7 files changed, 175 insertions(+), 16 deletions(-) -- 2.17.1