From patchwork Fri Nov 16 14:59:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 10686439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 927B717DE for ; Fri, 16 Nov 2018 15:04:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DF5129316 for ; Fri, 16 Nov 2018 15:04:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DFD52CC61; Fri, 16 Nov 2018 15:04:55 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0893629316 for ; Fri, 16 Nov 2018 15:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728124AbeKQBRi (ORCPT ); Fri, 16 Nov 2018 20:17:38 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:45999 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728169AbeKQBRi (ORCPT ); Fri, 16 Nov 2018 20:17:38 -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_Kleine-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-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-)