ANDROID: GKI: add back pm_runtime_get_if_in_use()

In commit a55d55a307 ("PM: runtime: Add pm_runtime_get_if_active()"),
pm_runtime_get_if_in_use() was replaced with an inline function.  That
would normally work just fine, except that function is part of the
Android abi, so the build breaks and so will any module that depends on
it.

So put the function back.

Bug: 161946584
Fixes: a55d55a307 ("PM: runtime: Add pm_runtime_get_if_active()")
Change-Id: Ib7dd90758f1daca3d075d0bf0ae1bfc88b321218
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2023-08-31 18:37:53 +00:00
parent 933d3af2e3
commit 8e2d221d14
2 changed files with 15 additions and 5 deletions

View File

@@ -1171,6 +1171,20 @@ int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count)
}
EXPORT_SYMBOL_GPL(pm_runtime_get_if_active);
/**
* pm_runtime_get_if_in_use - a wrapper around pm_runtime_get_if_active()
* @dev: Device to handle.
*
* In commit a55d55a30781 ("PM: runtime: Add pm_runtime_get_if_active()") it was
* removed but it was part of the Android API so put it back as just a call to
* pm_runtime_get_if_active() to keep the build working properly.
*/
int pm_runtime_get_if_in_use(struct device *dev)
{
return pm_runtime_get_if_active(dev, false);
}
EXPORT_SYMBOL_GPL(pm_runtime_get_if_in_use);
/**
* __pm_runtime_set_status - Set runtime PM status of a device.
* @dev: Device to handle.

View File

@@ -38,6 +38,7 @@ extern int pm_runtime_force_resume(struct device *dev);
extern int __pm_runtime_idle(struct device *dev, int rpmflags);
extern int __pm_runtime_suspend(struct device *dev, int rpmflags);
extern int __pm_runtime_resume(struct device *dev, int rpmflags);
extern int pm_runtime_get_if_in_use(struct device *dev);
extern int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count);
extern int pm_schedule_suspend(struct device *dev, unsigned int delay);
extern int __pm_runtime_set_status(struct device *dev, unsigned int status);
@@ -59,11 +60,6 @@ extern void pm_runtime_put_suppliers(struct device *dev);
extern void pm_runtime_new_link(struct device *dev);
extern void pm_runtime_drop_link(struct device_link *link);
static inline int pm_runtime_get_if_in_use(struct device *dev)
{
return pm_runtime_get_if_active(dev, false);
}
static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
{
dev->power.ignore_children = enable;