From: Paul Osmialowski <newchief@king.net.pl>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
Russell King <linux@arm.linux.org.uk>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Paul Osmialowski <pawelo@king.net.pl>
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 [thread overview]
Message-ID: <1443081808-19688-1-git-send-email-newchief@king.net.pl> (raw)
From: Paul Osmialowski <pawelo@king.net.pl>
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
next reply other threads:[~2015-09-24 8:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 8:03 Paul Osmialowski [this message]
2015-09-24 8:03 ` [PATCH 1/1] clk: " Paul Osmialowski
2015-09-28 23:13 ` Stephen Boyd
2015-09-28 23:05 ` [PATCH 0/1] " Stephen Boyd
2015-09-29 4:45 ` Paul Osmialowski
2015-09-30 22:04 ` Stephen Boyd
2015-10-01 7:52 ` Paul Osmialowski
2015-10-01 18:03 ` Stephen Boyd
2015-09-30 7:46 Paul Osmialowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443081808-19688-1-git-send-email-newchief@king.net.pl \
--to=newchief@king.net.pl \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mturquette@baylibre.com \
--cc=pawelo@king.net.pl \
--cc=sboyd@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®