diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index d2be321a275e..d3bffbbf5fcc 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -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. diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index f615e217e575..c7c754884cdc 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -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;