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: 10686423 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 8893217DE for ; Fri, 16 Nov 2018 15:00:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75EF52BB97 for ; Fri, 16 Nov 2018 15:00:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 699DA2C617; Fri, 16 Nov 2018 15:00:17 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 1B0542BB97 for ; Fri, 16 Nov 2018 15:00:17 +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: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:In-Reply-To: References:List-Owner; bh=/YByv4kEqNHjFVCXp/jt+d57hN9LJLFP5GMTOA0Ui2M=; b=SG6 j9A9IJVKBunkl/84uLy25MZdKmleCKqT2MlfvvLu72L6oKj8rbX9BTza+LDQtejuBfy3cCXgG2VEK F/03pcYAsZFR63v/ar5Jci7YyOEU0qaGdS4T68cODzqJ55kxIKABN5TyxgooNQB0XIbyQUPta/COh sLpPQuGbuhgk416LKtpNcUAkf6HZ7rEZOnLZ1Pw54Ca9qzxm+Rr3BU3NOi38SbZf+sDiN/lGsDBCH DmaVDKvQVtiGeVk9XBzgQsJ08t952jrMfKIekioHn/NEnUJqRDlTmia+MkXgDgQKYGHewbutBZBzU /4dwgmBARPhvjAynYLn/zq976X3pVVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNfbR-0006Yc-GM; Fri, 16 Nov 2018 15:00:13 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNfbP-0006YB-Be for linux-arm-kernel@bombadil.infradead.org; Fri, 16 Nov 2018 15:00:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Y3Naciw1bRSHKjUsFpZCg3Gta+6yr+gvDIsjUnK4Ycs=; b=GqJyjjZnIwpjaedbzzU7dXzfP RaVCXVxARy7rXEskoqXBL4n2Kd95JoDegjtMw2yPqBnj6fVXN5VZHw2qnwDhZOBcohxmM2IDy43wE AfiXx/uF7u7GHt7+W6lFJ+eruzj9BiBW7v62dzqOYjrPybmGRmSPHjE7NGHr9TaTCBoaFvkuyONAc qWG8QA+V0xaiMt9SFuMSwDNEF6PgnZmKjY1UATdUvIGLNcEUw/2MeXH+W1D+5tZpsqRYOtBnjofb+ A01byJfNCgNJPEN6CpZkfoip1moCRRJtfl73pzq9LsnPMHpdHx/G4tL+PG3wgj5Cz6ag9Zby6TgOA VL0iwo6rA==; Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNfbL-0006qp-F4 for linux-arm-kernel@lists.infradead.org; Fri, 16 Nov 2018 15:00:10 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181116_150007_727732_F40B1F62 X-CRM114-Status: UNSURE ( 9.06 ) X-CRM114-Notice: Please train this message. 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: linux-mips@linux-mips.org, Phil Edworthy , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 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(-)