]> git.karo-electronics.de Git - linux-beck.git/commitdiff
PM / Runtime: Remove the exported function pm_children_suspended()
authorUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Oct 2016 18:16:58 +0000 (20:16 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 21 Oct 2016 13:42:10 +0000 (15:42 +0200)
The exported function pm_children_suspended() has only one caller, which is
the runtime PM internal function, rpm_check_suspend_allowed().

Let's clean-up this code, by removing pm_children_suspended() altogether
and instead do the one-liner check directly in rpm_check_suspend_allowed().

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/runtime.c
include/linux/pm_runtime.h

index 82a081ea43176ca8e1d8accd886ad7065287a8aa..53b427dfc40392f8b8681091c945f6233bb17b8f 100644 (file)
@@ -241,7 +241,8 @@ static int rpm_check_suspend_allowed(struct device *dev)
                retval = -EACCES;
        else if (atomic_read(&dev->power.usage_count) > 0)
                retval = -EAGAIN;
-       else if (!pm_children_suspended(dev))
+       else if (!dev->power.ignore_children &&
+                       atomic_read(&dev->power.child_count))
                retval = -EBUSY;
 
        /* Pending resume requests take precedence over suspends. */
index 2e14d2667b6cb82af01145fe52e9ed828beb6812..61ea5666c94c33f2532f7bc066ee4dbc074fb243 100644 (file)
@@ -61,12 +61,6 @@ static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
        dev->power.ignore_children = enable;
 }
 
-static inline bool pm_children_suspended(struct device *dev)
-{
-       return dev->power.ignore_children
-               || !atomic_read(&dev->power.child_count);
-}
-
 static inline void pm_runtime_get_noresume(struct device *dev)
 {
        atomic_inc(&dev->power.usage_count);
@@ -162,7 +156,6 @@ static inline void pm_runtime_allow(struct device *dev) {}
 static inline void pm_runtime_forbid(struct device *dev) {}
 
 static inline void pm_suspend_ignore_children(struct device *dev, bool enable) {}
-static inline bool pm_children_suspended(struct device *dev) { return false; }
 static inline void pm_runtime_get_noresume(struct device *dev) {}
 static inline void pm_runtime_put_noidle(struct device *dev) {}
 static inline bool device_run_wake(struct device *dev) { return false; }