Skip to contentSkip to conversation

usb: dwc3: of-simple: remove include of clk-provider.h

PATCH New Shawn Guo 2 participants 2 messages Aug 13, 2017 – Aug 17, 2017

Subsystems (3)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH 1/1 usb: dwc3: of-simple: remove include of clk-provider.h

From: Shawn Guo <[email protected]>

The header clk-provider.h is there for clock drivers (providers) to include, not client drivers (consumers). That said, of_clk_get_parent_count() is a helper function for clock providers, not a clk API for consumers.

Let's replace of_clk_get_parent_count() with of_count_phandle_with_args() call, so that we can remove the include of clk-provider.h.

---
 drivers/usb/dwc3/dwc3-of-simple.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/dwc3/dwc3-of-simple.c +2 -2
index fe414e7a9c78..4cef7d4f9cd0 100644
@@ -25,7 +25,6 @@
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/clk.h>
-#include <linux/clk-provider.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/pm_runtime.h>
@@ -96,7 +95,8 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, simple);
 	simple->dev = dev;
 
-	ret = dwc3_of_simple_clk_init(simple, of_clk_get_parent_count(np));
+	ret = dwc3_of_simple_clk_init(simple, of_count_phandle_with_args(np,
+						"clocks", "#clock-cells"));
 	if (ret)
 		return ret;
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 usb: dwc3: of-simple: remove include of clk-provider.h

Quoted 7 lines · Shawn Guo

From: Shawn Guo <[email protected]>

The header clk-provider.h is there for clock drivers (providers) to include, not client drivers (consumers). That said, of_clk_get_parent_count() is a helper function for clock providers, not a clk API for consumers.

Quoted 5 lines

Let's replace of_clk_get_parent_count() with of_count_phandle_with_args() call, so that we can remove the include of clk-provider.h.

---

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project