diff mbox

clk: renesas: Use pm_clk_no_clocks() helper i.s.o. direct access

Message ID 1493141638-28940-1-git-send-email-geert+renesas@glider.be (mailing list archive)
State Accepted
Headers show

Commit Message

Geert Uytterhoeven April 25, 2017, 5:33 p.m. UTC
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>
---
To be queued up in clk-renesas-for-v4.13.

 drivers/clk/renesas/clk-mstp.c         | 2 +-
 drivers/clk/renesas/renesas-cpg-mssr.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Horman April 26, 2017, 7:11 a.m. UTC | #1
On Tue, Apr 25, 2017 at 07:33:58PM +0200, Geert Uytterhoeven wrote:
> 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>

--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven May 11, 2017, 9 a.m. UTC | #2
On Wed, Apr 26, 2017 at 9:11 AM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Apr 25, 2017 at 07:33:58PM +0200, Geert Uytterhoeven wrote:
>> 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>

Thanks, queued in clk-renesas-for-v4.13.

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
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
index 4067216bf31fbce9..f1617dd044cbbe15 100644
--- a/drivers/clk/renesas/clk-mstp.c
+++ b/drivers/clk/renesas/clk-mstp.c
@@ -325,7 +325,7 @@  int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev)
 
 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);
 }
 
diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c
index 99eeec6f24ec6c6b..38a01406740dfc04 100644
--- a/drivers/clk/renesas/renesas-cpg-mssr.c
+++ b/drivers/clk/renesas/renesas-cpg-mssr.c
@@ -477,7 +477,7 @@  int cpg_mssr_attach_dev(struct generic_pm_domain *unused, struct device *dev)
 
 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);
 }