Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1231950

[PATCH 0/1] add devm_of_clk_get() and devm_of_clk_get_by_name() functions

From Paul Osmialowski <newchief@king.net.pl>
Newsgroups linux.kernel
Subject [PATCH 0/1] add devm_of_clk_get() and devm_of_clk_get_by_name() functions
Date 2015-09-24 10:40 +0200
Message-ID <qcael-6bA-13@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 0/1] add devm_of_clk_get() and devm_of_clk_get_by_name() functions Paul Osmialowski <newchief@king.net.pl> - 2015-09-24 10:40 +0200
  Re: [PATCH 0/1] add devm_of_clk_get() and devm_of_clk_get_by_name()  functions Stephen Boyd <sboyd@codeaurora.org> - 2015-09-29 01:10 +0200
    Re: [PATCH 0/1] add devm_of_clk_get() and devm_of_clk_get_by_name()  functions Paul Osmialowski <pawelo@king.net.pl> - 2015-09-29 06:50 +0200
      Re: [PATCH 0/1] add devm_of_clk_get() and devm_of_clk_get_by_name()  functions Stephen Boyd <sboyd@codeaurora.org> - 2015-10-01 00:10 +0200
        Re: [PATCH 0/1] add devm_of_clk_get() and devm_of_clk_get_by_name()  functions Paul Osmialowski <pawelo@king.net.pl> - 2015-10-01 10:00 +0200
          Re: [PATCH 0/1] add devm_of_clk_get() and devm_of_clk_get_by_name()  functions Stephen Boyd <sboyd@codeaurora.org> - 2015-10-01 20:10 +0200

csiph-web