Skip to content

Commit 1acce02

Browse files
rafaeljwthierryreding
authored andcommitted
clk: tegra: Adjust callbacks in tegra_clock_pm
System suspend and resume callbacks run after the core has bumped up the runtime PM usage counters of all devices, so these callbacks need not worry about runtime PM reference counting. Accordingly, to eliminate useless overhead related to runtime PM usage counter manipulation, set the suspend callback pointer in tegra_clock_pm to a wrapper around pm_runtime_resume() called tegra_clock_suspend() and do not set the resume callback in it at all. This will also facilitate a planned change of the pm_runtime_put() return type to void in the future. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent fce0d0b commit 1acce02

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/clk/tegra/clk-device.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,19 @@ static int tegra_clock_probe(struct platform_device *pdev)
174174
* problem. In practice this makes no difference from a power management
175175
* perspective since voltage is kept at a nominal level during suspend anyways.
176176
*/
177+
static inline int tegra_clock_suspend(struct device *dev)
178+
{
179+
int ret;
180+
181+
ret = pm_runtime_resume(dev);
182+
if (ret < 0)
183+
return ret;
184+
185+
return 0;
186+
}
187+
177188
static const struct dev_pm_ops tegra_clock_pm = {
178-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_resume_and_get, pm_runtime_put)
189+
SET_SYSTEM_SLEEP_PM_OPS(tegra_clock_suspend, NULL)
179190
};
180191

181192
static const struct of_device_id tegra_clock_match[] = {

0 commit comments

Comments
 (0)