From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752022AbbIXIdm (ORCPT ); Thu, 24 Sep 2015 04:33:42 -0400 Received: from fish.king.net.pl ([79.190.246.46]:59955 "EHLO king.net.pl" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750915AbbIXIdj (ORCPT ); Thu, 24 Sep 2015 04:33:39 -0400 X-Greylist: delayed 1713 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 Sep 2015 04:33:38 EDT From: Paul Osmialowski To: Michael Turquette , Stephen Boyd , Russell King , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paul Osmialowski Subject: [PATCH 0/1] add devm_of_clk_get() and devm_of_clk_get_by_name() functions Date: Thu, 24 Sep 2015 10:03:27 +0200 Message-Id: <1443081808-19688-1-git-send-email-newchief@king.net.pl> X-Mailer: git-send-email 2.4.9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Osmialowski While working on my pinctrl driver I've found lack of devres compatible equivalent for of_clk_get() function. I'd like to use it for the following (incomplete) piece of device tree configuration: pinctrl: pinctrl { compatible = "fsl,kinetis-pinctrl"; #address-cells = <1>; #size-cells = <1>; ranges; port_a@40049000 { compatible = "fsl,kinetis-pin-bank"; reg = <0x40049000 0x1000>; clocks = <&sim SIM_CLK_SCGC5_PORTA>; }; port_b@4004a000 { compatible = "fsl,kinetis-pin-bank"; reg = <0x4004a000 0x1000>; clocks = <&sim SIM_CLK_SCGC5_PORTB>; }; ... }; In my pinconf-generic compatible fsl,kinetis-pinctrl driver, I'm iterating over fsl,kinetis-pin-bank nodes using for_each_child_of_node(dev->of_node, child) along with of_match_node() in order to grab resources (I/O base address, clock gate). Normally, I'd have to use of_clk_get() on each pin bank device_node and then worry about proper resource release myself. IMHO using devres infrastructure for this is far better. This patch adds missing functions needed to do it that way. Paul Osmialowski (1): clk: add devm_of_clk_get() and devm_of_clk_get_by_name() functions drivers/clk/clk-devres.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ include/linux/clk.h | 20 ++++++++++++++++++++ 2 files changed, 66 insertions(+) -- 2.4.9