]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
clk: core: clarify the check for runtime PM
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 4 Dec 2018 19:24:37 +0000 (20:24 +0100)
committerStephen Boyd <sboyd@kernel.org>
Fri, 1 Mar 2019 19:17:16 +0000 (11:17 -0800)
commit2447883934a03c80a85d92cd313ea1d10e330158
tree409aaf494a286fe60f134b4bee5bd1f201c545a6
parent1df4046a93e086f77d244ea47c21591b4acad3e2
clk: core: clarify the check for runtime PM

Currently, the core->dev entry is populated only if runtime PM is
enabled. Doing so prevents accessing the device structure in any
case.

Keep the same logic but instead of using the presence of core->dev as
the only condition, also check the status of
pm_runtime_enabled(). Then, we can set the core->dev pointer at any
time as long as a device structure is available.

This change will help supporting device links in the clock subsystem.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Chen-Yu Tsai <wens@csie.org>
[sboyd@kernel.org: Change to a boolean flag]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk.c