summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/base/power/runtime.c17
-rw-r--r--include/linux/pm_runtime.h12
2 files changed, 11 insertions, 18 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 3d08eb677177..42a58ed45a08 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1560,23 +1560,6 @@ out:
}
EXPORT_SYMBOL_GPL(pm_runtime_enable);
-bool pm_runtime_blocked(struct device *dev)
-{
- bool ret;
-
- /*
- * dev->power.last_status is a bit field, so in case it is updated via
- * RMW, read it under the spin lock.
- */
- spin_lock_irq(&dev->power.lock);
-
- ret = dev->power.last_status == RPM_BLOCKED;
-
- spin_unlock_irq(&dev->power.lock);
-
- return ret;
-}
-
static void pm_runtime_disable_action(void *data)
{
pm_runtime_dont_use_autosuspend(data);
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 4c5b74b745d5..7fb5a459847e 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -82,7 +82,6 @@ extern bool pm_runtime_block_if_disabled(struct device *dev);
extern void pm_runtime_unblock(struct device *dev);
extern void pm_runtime_enable(struct device *dev);
extern void __pm_runtime_disable(struct device *dev, bool check_resume);
-extern bool pm_runtime_blocked(struct device *dev);
extern void pm_runtime_allow(struct device *dev);
extern void pm_runtime_forbid(struct device *dev);
extern void pm_runtime_no_callbacks(struct device *dev);
@@ -201,6 +200,17 @@ static inline bool pm_runtime_enabled(struct device *dev)
}
/**
+ * pm_runtime_blocked - Check if runtime PM enabling is blocked.
+ * @dev: Target device.
+ *
+ * Do not call this function outside system suspend/resume code paths.
+ */
+static inline bool pm_runtime_blocked(struct device *dev)
+{
+ return dev->power.last_status == RPM_BLOCKED;
+}
+
+/**
* pm_runtime_has_no_callbacks - Check if runtime PM callbacks may be present.
* @dev: Target device.
*