Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e2d221d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

ANDROID: GKI: add back pm_runtime_get_if_in_use()



In commit a55d55a3 ("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: a55d55a3 ("PM: runtime: Add pm_runtime_get_if_active()")
Change-Id: Ib7dd90758f1daca3d075d0bf0ae1bfc88b321218
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 933d3af2
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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.
+1 −5
Original line number Diff line number Diff line
@@ -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;