LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v3 0/5] Use of_clk_get_parent_count() instead of open coding
@ 2018-04-18 14:50 Geert Uytterhoeven
  2018-04-18 14:50 ` [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h> Geert Uytterhoeven
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2018-04-18 14:50 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

	Hi Mike, Stephen, et al,

This patch series replaces open-coded versions of
of_clk_get_parent_count() by calls to the helper function.

Changes compared to v2:
  - Add Acked-by, Reviewed-by,
  - Add SPDX-License-Identifier to <linux/of_clk.h>,
  - Add <linux/of_clk.h> to clock section in MAINTAINERS (note that Rob
    is still listed as a maintainer, too, due to the include/linux/of*.h
    catch-all rule),

Changes compared to v1:
  - Move OF clock helpers (a.o. of_clk_get_parent_count()) to their own
    include file <linux/of_clk.h>, as suggested by Stephen,
  - Update includes for the above change,
  - Fix timer-sp804, now a dummy is available in the !CONFIG_COMMON_CLK
    case,
  - Fix a new occurrence.

Note that patches 2-5 depend on the first patch.

Thanks!

Geert Uytterhoeven (5):
  clk: Extract OF clock helpers in <linux/of_clk.h>
  ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding
  soc: rockchip: power-domain: Use of_clk_get_parent_count() instead of
    open coding
  soc/tegra: pmc: Use of_clk_get_parent_count() instead of open coding
  pinctrl: sunxi: Use of_clk_get_parent_count() instead of open coding

 MAINTAINERS                           |  1 +
 drivers/clocksource/timer-sp804.c     |  3 ++-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c |  4 ++--
 drivers/soc/rockchip/pm_domains.c     |  4 ++--
 drivers/soc/tegra/pmc.c               |  3 ++-
 include/linux/clk-provider.h          | 14 +-------------
 include/linux/of_clk.h                | 30 ++++++++++++++++++++++++++++++
 7 files changed, 40 insertions(+), 19 deletions(-)
 create mode 100644 include/linux/of_clk.h

-- 
2.7.4

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h>
  2018-04-18 14:50 [PATCH v3 0/5] Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
@ 2018-04-18 14:50 ` Geert Uytterhoeven
  2018-04-19 22:25   ` Stephen Boyd
  2018-05-02 15:38   ` Stephen Boyd
  2018-04-18 14:50 ` [PATCH v3 2/5] ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2018-04-18 14:50 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

The use of of_clk_get_parent_{count,name}() and of_clk_init() is not
limited to clock providers.

Hence move these helpers into their own header file, so callers that are
not clock providers no longer have to include <linux/clk-provider.h>.

Suggested-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
---
v3:
  - Add Reviewed-by,
  - Add SPDX-License-Identifier,
  - Add to clock section in MAINTAINERS (note that Rob is still listed
    as a maintainer, too, due to the include/linux/of*.h catch-all
    rule),

v2:
  - New.
---
 MAINTAINERS                  |  1 +
 include/linux/clk-provider.h | 14 +-------------
 include/linux/of_clk.h       | 30 ++++++++++++++++++++++++++++++
 3 files changed, 32 insertions(+), 13 deletions(-)
 create mode 100644 include/linux/of_clk.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 50927cba875771e8..abf08b50a85d969d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3556,6 +3556,7 @@ F:	drivers/clk/
 X:	drivers/clk/clkdev.c
 F:	include/linux/clk-pr*
 F:	include/linux/clk/
+F:	include/linux/of_clk.h
 
 COMMON INTERNET FILE SYSTEM (CIFS)
 M:	Steve French <sfrench@samba.org>
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 210a890008f9e129..61cb4729f22acd6b 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -13,6 +13,7 @@
 
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/of_clk.h>
 
 #ifdef CONFIG_COMMON_CLK
 
@@ -890,13 +891,10 @@ struct clk_hw *of_clk_hw_simple_get(struct of_phandle_args *clkspec,
 struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
 struct clk_hw *of_clk_hw_onecell_get(struct of_phandle_args *clkspec,
 				     void *data);
-unsigned int of_clk_get_parent_count(struct device_node *np);
 int of_clk_parent_fill(struct device_node *np, const char **parents,
 		       unsigned int size);
-const char *of_clk_get_parent_name(struct device_node *np, int index);
 int of_clk_detect_critical(struct device_node *np, int index,
 			    unsigned long *flags);
-void of_clk_init(const struct of_device_id *matches);
 
 #else /* !CONFIG_OF */
 
@@ -943,26 +941,16 @@ of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data)
 {
 	return ERR_PTR(-ENOENT);
 }
-static inline unsigned int of_clk_get_parent_count(struct device_node *np)
-{
-	return 0;
-}
 static inline int of_clk_parent_fill(struct device_node *np,
 				     const char **parents, unsigned int size)
 {
 	return 0;
 }
-static inline const char *of_clk_get_parent_name(struct device_node *np,
-						 int index)
-{
-	return NULL;
-}
 static inline int of_clk_detect_critical(struct device_node *np, int index,
 					  unsigned long *flags)
 {
 	return 0;
 }
-static inline void of_clk_init(const struct of_device_id *matches) {}
 #endif /* CONFIG_OF */
 
 /*
diff --git a/include/linux/of_clk.h b/include/linux/of_clk.h
new file mode 100644
index 0000000000000000..b27da9f164cbd221
--- /dev/null
+++ b/include/linux/of_clk.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * OF clock helpers
+ */
+
+#ifndef __LINUX_OF_CLK_H
+#define __LINUX_OF_CLK_H
+
+#if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF)
+
+unsigned int of_clk_get_parent_count(struct device_node *np);
+const char *of_clk_get_parent_name(struct device_node *np, int index);
+void of_clk_init(const struct of_device_id *matches);
+
+#else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
+
+static inline unsigned int of_clk_get_parent_count(struct device_node *np)
+{
+	return 0;
+}
+static inline const char *of_clk_get_parent_name(struct device_node *np,
+						 int index)
+{
+	return NULL;
+}
+static inline void of_clk_init(const struct of_device_id *matches) {}
+
+#endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */
+
+#endif /* __LINUX_OF_CLK_H */
-- 
2.7.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3 2/5] ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 [PATCH v3 0/5] Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
  2018-04-18 14:50 ` [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h> Geert Uytterhoeven
@ 2018-04-18 14:50 ` Geert Uytterhoeven
  2018-05-02 15:38   ` Stephen Boyd
  2018-04-18 14:50 ` [PATCH v3 3/5] soc: rockchip: power-domain: " Geert Uytterhoeven
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2018-04-18 14:50 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
This depends on "[PATCH v3 1/5] clk: Extract OF clock helpers in
<linux/of_clk.h>".

v3:
  - Add Acked-by,

v2:
  - of_clk_get_parent_count() was moved to <linux/of_clk.h>,
  - Dropped RFC, as a dummy is now available in the !CONFIG_COMMON_CLK
    case.
---
 drivers/clocksource/timer-sp804.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c
index 3ac9dec9a03852f9..e01222ea888ff9d2 100644
--- a/drivers/clocksource/timer-sp804.c
+++ b/drivers/clocksource/timer-sp804.c
@@ -27,6 +27,7 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_clk.h>
 #include <linux/of_irq.h>
 #include <linux/sched_clock.h>
 
@@ -245,7 +246,7 @@ static int __init sp804_of_init(struct device_node *np)
 		clk1 = NULL;
 
 	/* Get the 2nd clock if the timer has 3 timer clocks */
-	if (of_count_phandle_with_args(np, "clocks", "#clock-cells") == 3) {
+	if (of_clk_get_parent_count(np) == 3) {
 		clk2 = of_clk_get(np, 1);
 		if (IS_ERR(clk2)) {
 			pr_err("sp804: %s clock not found: %d\n", np->name,
-- 
2.7.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3 3/5] soc: rockchip: power-domain: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 [PATCH v3 0/5] Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
  2018-04-18 14:50 ` [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h> Geert Uytterhoeven
  2018-04-18 14:50 ` [PATCH v3 2/5] ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
@ 2018-04-18 14:50 ` Geert Uytterhoeven
  2018-04-30 13:41   ` Daniel Lezcano
  2018-05-02 15:38   ` Stephen Boyd
  2018-04-18 14:50 ` [PATCH v3 4/5] soc/tegra: pmc: " Geert Uytterhoeven
  2018-04-18 14:50 ` [PATCH v3 5/5] pinctrl: sunxi: " Geert Uytterhoeven
  4 siblings, 2 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2018-04-18 14:50 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

As of_clk_get_parent_count() returns zero on failure, while
of_count_phandle_with_args() might return a negative error code, this
also fixes the issue of possibly using a negative number in the
allocation below.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
---
This depends on "[PATCH v3 1/5] clk: Extract OF clock helpers in
<linux/of_clk.h>".

v3:
  - Add Reviewed-by,

v2:
  - of_clk_get_parent_count() was moved to <linux/of_clk.h>.
---
 drivers/soc/rockchip/pm_domains.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index 53efc386b1ada8cf..13913d40c8213e36 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -14,6 +14,7 @@
 #include <linux/pm_clock.h>
 #include <linux/pm_domain.h>
 #include <linux/of_address.h>
+#include <linux/of_clk.h>
 #include <linux/of_platform.h>
 #include <linux/clk.h>
 #include <linux/regmap.h>
@@ -400,8 +401,7 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
 	pd->info = pd_info;
 	pd->pmu = pmu;
 
-	pd->num_clks = of_count_phandle_with_args(node, "clocks",
-						  "#clock-cells");
+	pd->num_clks = of_clk_get_parent_count(node);
 	if (pd->num_clks > 0) {
 		pd->clks = devm_kcalloc(pmu->dev, pd->num_clks,
 					sizeof(*pd->clks), GFP_KERNEL);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3 4/5] soc/tegra: pmc: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 [PATCH v3 0/5] Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2018-04-18 14:50 ` [PATCH v3 3/5] soc: rockchip: power-domain: " Geert Uytterhoeven
@ 2018-04-18 14:50 ` Geert Uytterhoeven
  2018-04-30 13:44   ` Daniel Lezcano
  2018-05-02 15:38   ` Stephen Boyd
  2018-04-18 14:50 ` [PATCH v3 5/5] pinctrl: sunxi: " Geert Uytterhoeven
  4 siblings, 2 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2018-04-18 14:50 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

As of_clk_get_parent_count() returns zero on failure, while
of_count_phandle_with_args() might return a negative error code, this
also fixes the issue of possibly using a very big number in the
allocation below.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
---
This depends on "[PATCH v3 1/5] clk: Extract OF clock helpers in
<linux/of_clk.h>".

v3:
  - Add Acked-by,

v2:
  - of_clk_get_parent_count() was moved to <linux/of_clk.h>.
---
 drivers/soc/tegra/pmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index d9fcdb592b3966a5..d8cb48a4b8eb1b78 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -31,6 +31,7 @@
 #include <linux/iopoll.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_clk.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
@@ -725,7 +726,7 @@ static int tegra_powergate_of_get_clks(struct tegra_powergate *pg,
 	unsigned int i, count;
 	int err;
 
-	count = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+	count = of_clk_get_parent_count(np);
 	if (count == 0)
 		return -ENODEV;
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3 5/5] pinctrl: sunxi: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 [PATCH v3 0/5] Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2018-04-18 14:50 ` [PATCH v3 4/5] soc/tegra: pmc: " Geert Uytterhoeven
@ 2018-04-18 14:50 ` Geert Uytterhoeven
  2018-04-26 11:57   ` Linus Walleij
                     ` (2 more replies)
  4 siblings, 3 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2018-04-18 14:50 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

A new open coder has crept in since 470b73a38470e8ba ("pinctrl: sunxi:
Use of_clk_get_parent_count() instead of open coding"), replace it.

of_clk_get_parent_count() was moved to <linux/of_clk.h>, so include that
instead of <linux/clk-provider.h>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
This depends on "[PATCH v3 1/5] clk: Extract OF clock helpers in
<linux/of_clk.h>".

v3:
  - Add Acked-by,

v2:
  - New.
---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 020d6d84639ca002..25e80a5370ca02f6 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -12,12 +12,12 @@
 
 #include <linux/io.h>
 #include <linux/clk.h>
-#include <linux/clk-provider.h>
 #include <linux/gpio/driver.h>
 #include <linux/irqdomain.h>
 #include <linux/irqchip/chained_irq.h>
 #include <linux/export.h>
 #include <linux/of.h>
+#include <linux/of_clk.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/of_irq.h>
@@ -1361,7 +1361,7 @@ int sunxi_pinctrl_init_with_variant(struct platform_device *pdev,
 			goto gpiochip_error;
 	}
 
-	ret = of_count_phandle_with_args(node, "clocks", "#clock-cells");
+	ret = of_clk_get_parent_count(node);
 	clk = devm_clk_get(&pdev->dev, ret == 1 ? NULL : "apb");
 	if (IS_ERR(clk)) {
 		ret = PTR_ERR(clk);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h>
  2018-04-18 14:50 ` [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h> Geert Uytterhoeven
@ 2018-04-19 22:25   ` Stephen Boyd
  2018-04-20  6:28     ` Geert Uytterhoeven
  2018-05-02 15:38   ` Stephen Boyd
  1 sibling, 1 reply; 18+ messages in thread
From: Stephen Boyd @ 2018-04-19 22:25 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

Quoting Geert Uytterhoeven (2018-04-18 07:50:01)
> The use of of_clk_get_parent_{count,name}() and of_clk_init() is not
> limited to clock providers.
> 
> Hence move these helpers into their own header file, so callers that are
> not clock providers no longer have to include <linux/clk-provider.h>.
> 
> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> ---
> v3:
>   - Add Reviewed-by,
>   - Add SPDX-License-Identifier,
>   - Add to clock section in MAINTAINERS (note that Rob is still listed
>     as a maintainer, too, due to the include/linux/of*.h catch-all
>     rule),

Can you X: out this file so Rob is happy? Or that doesn't work?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h>
  2018-04-19 22:25   ` Stephen Boyd
@ 2018-04-20  6:28     ` Geert Uytterhoeven
  2018-04-24 15:44       ` Rob Herring
  0 siblings, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2018-04-20  6:28 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Geert Uytterhoeven, Michael Turquette, Rob Herring, Frank Rowand,
	Daniel Lezcano, Thomas Gleixner, Maxime Ripard, Chen-Yu Tsai,
	Linus Walleij, Heiko Stuebner, Thierry Reding, Jonathan Hunter,
	linux-clk, Linux ARM, open list:GPIO SUBSYSTEM,
	open list:ARM/Rockchip SoC...,
	linux-tegra,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Kernel Mailing List

Hi Stephen, Rob,

On Fri, Apr 20, 2018 at 12:25 AM, Stephen Boyd <sboyd@kernel.org> wrote:
> Quoting Geert Uytterhoeven (2018-04-18 07:50:01)
>> The use of of_clk_get_parent_{count,name}() and of_clk_init() is not
>> limited to clock providers.
>>
>> Hence move these helpers into their own header file, so callers that are
>> not clock providers no longer have to include <linux/clk-provider.h>.
>>
>> Suggested-by: Stephen Boyd <sboyd@kernel.org>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
>> ---
>> v3:
>>   - Add Reviewed-by,
>>   - Add SPDX-License-Identifier,
>>   - Add to clock section in MAINTAINERS (note that Rob is still listed
>>     as a maintainer, too, due to the include/linux/of*.h catch-all
>>     rule),
>
> Can you X: out this file so Rob is happy? Or that doesn't work?

I guess that should work.

My point here is that due to the catch-all rule, he's listed as maintainer
for of_{dma,gpio,irq,iommu,mdio,net,pci} too, which are all helpers for
other subsystems. Perhaps these should be X'd-out too?
Or is it OK without X-ing them out, as the clock maintainers are now shown, too?

Rob: What's your preference?

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h>
  2018-04-20  6:28     ` Geert Uytterhoeven
@ 2018-04-24 15:44       ` Rob Herring
  0 siblings, 0 replies; 18+ messages in thread
From: Rob Herring @ 2018-04-24 15:44 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Stephen Boyd, Geert Uytterhoeven, Michael Turquette,
	Frank Rowand, Daniel Lezcano, Thomas Gleixner, Maxime Ripard,
	Chen-Yu Tsai, Linus Walleij, Heiko Stuebner, Thierry Reding,
	Jonathan Hunter, linux-clk, Linux ARM, open list:GPIO SUBSYSTEM,
	open list:ARM/Rockchip SoC...,
	linux-tegra,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Kernel Mailing List

On Fri, Apr 20, 2018 at 08:28:28AM +0200, Geert Uytterhoeven wrote:
> Hi Stephen, Rob,
> 
> On Fri, Apr 20, 2018 at 12:25 AM, Stephen Boyd <sboyd@kernel.org> wrote:
> > Quoting Geert Uytterhoeven (2018-04-18 07:50:01)
> >> The use of of_clk_get_parent_{count,name}() and of_clk_init() is not
> >> limited to clock providers.
> >>
> >> Hence move these helpers into their own header file, so callers that are
> >> not clock providers no longer have to include <linux/clk-provider.h>.
> >>
> >> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> >> ---
> >> v3:
> >>   - Add Reviewed-by,
> >>   - Add SPDX-License-Identifier,
> >>   - Add to clock section in MAINTAINERS (note that Rob is still listed
> >>     as a maintainer, too, due to the include/linux/of*.h catch-all
> >>     rule),
> >
> > Can you X: out this file so Rob is happy? Or that doesn't work?
> 
> I guess that should work.
> 
> My point here is that due to the catch-all rule, he's listed as maintainer
> for of_{dma,gpio,irq,iommu,mdio,net,pci} too, which are all helpers for
> other subsystems. Perhaps these should be X'd-out too?
> Or is it OK without X-ing them out, as the clock maintainers are now shown, too?
> 
> Rob: What's your preference?

It's fine as-is.

Rob

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 5/5] pinctrl: sunxi: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 ` [PATCH v3 5/5] pinctrl: sunxi: " Geert Uytterhoeven
@ 2018-04-26 11:57   ` Linus Walleij
  2018-04-30 13:46   ` Daniel Lezcano
  2018-05-02 15:38   ` Stephen Boyd
  2 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2018-04-26 11:57 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, Rob Herring, Frank Rowand,
	Daniel Lezcano, Thomas Gleixner, Maxime Ripard, Chen-Yu Tsai,
	Heiko Stuebner, Thierry Reding, Jonathan Hunter, linux-clk,
	Linux ARM, open list:GPIO SUBSYSTEM,
	open list:ARM/Rockchip SoC...,
	linux-tegra,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel

On Wed, Apr 18, 2018 at 4:50 PM, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:

> A new open coder has crept in since 470b73a38470e8ba ("pinctrl: sunxi:
> Use of_clk_get_parent_count() instead of open coding"), replace it.
>
> of_clk_get_parent_count() was moved to <linux/of_clk.h>, so include that
> instead of <linux/clk-provider.h>.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
> This depends on "[PATCH v3 1/5] clk: Extract OF clock helpers in
> <linux/of_clk.h>".
>
> v3:
>   - Add Acked-by,

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Please merge this through the clk tree.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 3/5] soc: rockchip: power-domain: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 ` [PATCH v3 3/5] soc: rockchip: power-domain: " Geert Uytterhoeven
@ 2018-04-30 13:41   ` Daniel Lezcano
  2018-05-02 15:38   ` Stephen Boyd
  1 sibling, 0 replies; 18+ messages in thread
From: Daniel Lezcano @ 2018-04-30 13:41 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, Rob Herring, Frank Rowand,
	Thomas Gleixner, Maxime Ripard, Chen-Yu Tsai, Linus Walleij,
	Heiko Stuebner, Thierry Reding, Jonathan Hunter, linux-clk,
	linux-arm-kernel, linux-gpio, linux-rockchip, linux-tegra,
	devicetree, linux-kernel

On Wed, Apr 18, 2018 at 04:50:03PM +0200, Geert Uytterhoeven wrote:
> As of_clk_get_parent_count() returns zero on failure, while
> of_count_phandle_with_args() might return a negative error code, this
> also fixes the issue of possibly using a negative number in the
> allocation below.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>

Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 4/5] soc/tegra: pmc: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 ` [PATCH v3 4/5] soc/tegra: pmc: " Geert Uytterhoeven
@ 2018-04-30 13:44   ` Daniel Lezcano
  2018-05-02 15:38   ` Stephen Boyd
  1 sibling, 0 replies; 18+ messages in thread
From: Daniel Lezcano @ 2018-04-30 13:44 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, Rob Herring, Frank Rowand,
	Thomas Gleixner, Maxime Ripard, Chen-Yu Tsai, Linus Walleij,
	Heiko Stuebner, Thierry Reding, Jonathan Hunter, linux-clk,
	linux-arm-kernel, linux-gpio, linux-rockchip, linux-tegra,
	devicetree, linux-kernel

On Wed, Apr 18, 2018 at 04:50:04PM +0200, Geert Uytterhoeven wrote:
> As of_clk_get_parent_count() returns zero on failure, while
> of_count_phandle_with_args() might return a negative error code, this
> also fixes the issue of possibly using a very big number in the
> allocation below.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> This depends on "[PATCH v3 1/5] clk: Extract OF clock helpers in
> <linux/of_clk.h>".
> 
> v3:
>   - Add Acked-by,
> 
> v2:
>   - of_clk_get_parent_count() was moved to <linux/of_clk.h>.
> ---

Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>




 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 5/5] pinctrl: sunxi: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 ` [PATCH v3 5/5] pinctrl: sunxi: " Geert Uytterhoeven
  2018-04-26 11:57   ` Linus Walleij
@ 2018-04-30 13:46   ` Daniel Lezcano
  2018-05-02 15:38   ` Stephen Boyd
  2 siblings, 0 replies; 18+ messages in thread
From: Daniel Lezcano @ 2018-04-30 13:46 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, Rob Herring, Frank Rowand,
	Thomas Gleixner, Maxime Ripard, Chen-Yu Tsai, Linus Walleij,
	Heiko Stuebner, Thierry Reding, Jonathan Hunter, linux-clk,
	linux-arm-kernel, linux-gpio, linux-rockchip, linux-tegra,
	devicetree, linux-kernel

On Wed, Apr 18, 2018 at 04:50:05PM +0200, Geert Uytterhoeven wrote:
> A new open coder has crept in since 470b73a38470e8ba ("pinctrl: sunxi:
> Use of_clk_get_parent_count() instead of open coding"), replace it.
> 
> of_clk_get_parent_count() was moved to <linux/of_clk.h>, so include that
> instead of <linux/clk-provider.h>.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
> This depends on "[PATCH v3 1/5] clk: Extract OF clock helpers in
> <linux/of_clk.h>".
> 
> v3:
>   - Add Acked-by,
> 
> v2:
>   - New.
> ---

Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>

-- 

 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h>
  2018-04-18 14:50 ` [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h> Geert Uytterhoeven
  2018-04-19 22:25   ` Stephen Boyd
@ 2018-05-02 15:38   ` Stephen Boyd
  1 sibling, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2018-05-02 15:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

Quoting Geert Uytterhoeven (2018-04-18 07:50:01)
> The use of of_clk_get_parent_{count,name}() and of_clk_init() is not
> limited to clock providers.
> 
> Hence move these helpers into their own header file, so callers that are
> not clock providers no longer have to include <linux/clk-provider.h>.
> 
> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/5] ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 ` [PATCH v3 2/5] ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
@ 2018-05-02 15:38   ` Stephen Boyd
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2018-05-02 15:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

Quoting Geert Uytterhoeven (2018-04-18 07:50:02)
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 3/5] soc: rockchip: power-domain: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 ` [PATCH v3 3/5] soc: rockchip: power-domain: " Geert Uytterhoeven
  2018-04-30 13:41   ` Daniel Lezcano
@ 2018-05-02 15:38   ` Stephen Boyd
  1 sibling, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2018-05-02 15:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

Quoting Geert Uytterhoeven (2018-04-18 07:50:03)
> As of_clk_get_parent_count() returns zero on failure, while
> of_count_phandle_with_args() might return a negative error code, this
> also fixes the issue of possibly using a negative number in the
> allocation below.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 4/5] soc/tegra: pmc: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 ` [PATCH v3 4/5] soc/tegra: pmc: " Geert Uytterhoeven
  2018-04-30 13:44   ` Daniel Lezcano
@ 2018-05-02 15:38   ` Stephen Boyd
  1 sibling, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2018-05-02 15:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

Quoting Geert Uytterhoeven (2018-04-18 07:50:04)
> As of_clk_get_parent_count() returns zero on failure, while
> of_count_phandle_with_args() might return a negative error code, this
> also fixes the issue of possibly using a very big number in the
> allocation below.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Jon Hunter <jonathanh@nvidia.com>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 5/5] pinctrl: sunxi: Use of_clk_get_parent_count() instead of open coding
  2018-04-18 14:50 ` [PATCH v3 5/5] pinctrl: sunxi: " Geert Uytterhoeven
  2018-04-26 11:57   ` Linus Walleij
  2018-04-30 13:46   ` Daniel Lezcano
@ 2018-05-02 15:38   ` Stephen Boyd
  2 siblings, 0 replies; 18+ messages in thread
From: Stephen Boyd @ 2018-05-02 15:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette
  Cc: Rob Herring, Frank Rowand, Daniel Lezcano, Thomas Gleixner,
	Maxime Ripard, Chen-Yu Tsai, Linus Walleij, Heiko Stuebner,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-arm-kernel,
	linux-gpio, linux-rockchip, linux-tegra, devicetree,
	linux-kernel, Geert Uytterhoeven

Quoting Geert Uytterhoeven (2018-04-18 07:50:05)
> A new open coder has crept in since 470b73a38470e8ba ("pinctrl: sunxi:
> Use of_clk_get_parent_count() instead of open coding"), replace it.
> 
> of_clk_get_parent_count() was moved to <linux/of_clk.h>, so include that
> instead of <linux/clk-provider.h>.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-05-02 15:39 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18 14:50 [PATCH v3 0/5] Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
2018-04-18 14:50 ` [PATCH v3 1/5] clk: Extract OF clock helpers in <linux/of_clk.h> Geert Uytterhoeven
2018-04-19 22:25   ` Stephen Boyd
2018-04-20  6:28     ` Geert Uytterhoeven
2018-04-24 15:44       ` Rob Herring
2018-05-02 15:38   ` Stephen Boyd
2018-04-18 14:50 ` [PATCH v3 2/5] ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding Geert Uytterhoeven
2018-05-02 15:38   ` Stephen Boyd
2018-04-18 14:50 ` [PATCH v3 3/5] soc: rockchip: power-domain: " Geert Uytterhoeven
2018-04-30 13:41   ` Daniel Lezcano
2018-05-02 15:38   ` Stephen Boyd
2018-04-18 14:50 ` [PATCH v3 4/5] soc/tegra: pmc: " Geert Uytterhoeven
2018-04-30 13:44   ` Daniel Lezcano
2018-05-02 15:38   ` Stephen Boyd
2018-04-18 14:50 ` [PATCH v3 5/5] pinctrl: sunxi: " Geert Uytterhoeven
2018-04-26 11:57   ` Linus Walleij
2018-04-30 13:46   ` Daniel Lezcano
2018-05-02 15:38   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).