clk: renesas: Use pm_clk_no_clocks() helper i.s.o. direct access
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 8 Feb 2017 18:08:44 +0000 (19:08 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 15 May 2017 07:46:31 +0000 (09:46 +0200)
The pm_subsys_data.clock_list member exists only if CONFIG_PM_CLK=y.
Hence direct accesses to this field break compile-testing on platforms
where CONFIG_PM_CLK=n.

To fix this, use the pm_clk_no_clocks() helper instead, for which a
dummy version is provided if CONFIG_PM_CLK=n.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
drivers/clk/renesas/clk-mstp.c
drivers/clk/renesas/renesas-cpg-mssr.c

index 4067216bf31fbce9d3b62454b5565a80a92aa5a4..f1617dd044cbbe15bdd8c4722a9c7c2042d609b8 100644 (file)
@@ -325,7 +325,7 @@ fail_put:
 
 void cpg_mstp_detach_dev(struct generic_pm_domain *unused, struct device *dev)
 {
-       if (!list_empty(&dev->power.subsys_data->clock_list))
+       if (!pm_clk_no_clocks(dev))
                pm_clk_destroy(dev);
 }
 
index 99eeec6f24ec6c6b29b60de7ad4c5644b37630d4..38a01406740dfc04e8da30ea49aca19eb2f69616 100644 (file)
@@ -477,7 +477,7 @@ fail_put:
 
 void cpg_mssr_detach_dev(struct generic_pm_domain *unused, struct device *dev)
 {
-       if (!list_empty(&dev->power.subsys_data->clock_list))
+       if (!pm_clk_no_clocks(dev))
                pm_clk_destroy(dev);
 }