]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/base/power/common.c
PM: Convert dev_pm_put_subsys_data() into a void function
[mirror_ubuntu-bionic-kernel.git] / drivers / base / power / common.c
index b0f138806bbc4cb67bc782c075a9228acc500f12..f32b802b98f4b56bc0e733fe1efe5b81b182b009 100644 (file)
@@ -19,8 +19,8 @@
  * @dev: Device to handle.
  *
  * If power.subsys_data is NULL, point it to a new object, otherwise increment
- * its reference counter.  Return 1 if a new object has been created, otherwise
- * return 0 or error code.
+ * its reference counter.  Return 0 if new object has been created or refcount
+ * increased, otherwise negative error code.
  */
 int dev_pm_get_subsys_data(struct device *dev)
 {
@@ -56,13 +56,11 @@ EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data);
  * @dev: Device to handle.
  *
  * If the reference counter of power.subsys_data is zero after dropping the
- * reference, power.subsys_data is removed.  Return 1 if that happens or 0
- * otherwise.
+ * reference, power.subsys_data is removed.
  */
-int dev_pm_put_subsys_data(struct device *dev)
+void dev_pm_put_subsys_data(struct device *dev)
 {
        struct pm_subsys_data *psd;
-       int ret = 1;
 
        spin_lock_irq(&dev->power.lock);
 
@@ -70,18 +68,14 @@ int dev_pm_put_subsys_data(struct device *dev)
        if (!psd)
                goto out;
 
-       if (--psd->refcount == 0) {
+       if (--psd->refcount == 0)
                dev->power.subsys_data = NULL;
-       } else {
+       else
                psd = NULL;
-               ret = 0;
-       }
 
  out:
        spin_unlock_irq(&dev->power.lock);
        kfree(psd);
-
-       return ret;
 }
 EXPORT_SYMBOL_GPL(dev_pm_put_subsys_data);