Skip to content

Commit 9a78754

Browse files
committed
PM: runtime: Replace pm_runtime_callbacks_present()
The name of pm_runtime_callbacks_present() is confusing, because it suggests that the device has PM-runtime callbacks if 'true' is returned by that function, but in fact that may not be the case, so replace it with pm_runtime_has_no_callbacks() which is not ambiguous. No functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Ulf Hansson <[email protected]>
1 parent 64c7d7e commit 9a78754

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/base/power/sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ int dpm_sysfs_add(struct device *dev)
666666
if (rc)
667667
return rc;
668668

669-
if (pm_runtime_callbacks_present(dev)) {
669+
if (!pm_runtime_has_no_callbacks(dev)) {
670670
rc = sysfs_merge_group(&dev->kobj, &pm_runtime_attr_group);
671671
if (rc)
672672
goto err_out;
@@ -709,7 +709,7 @@ int dpm_sysfs_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid)
709709
if (rc)
710710
return rc;
711711

712-
if (pm_runtime_callbacks_present(dev)) {
712+
if (!pm_runtime_has_no_callbacks(dev)) {
713713
rc = sysfs_group_change_owner(
714714
&dev->kobj, &pm_runtime_attr_group, kuid, kgid);
715715
if (rc)

include/linux/pm_runtime.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ static inline bool pm_runtime_enabled(struct device *dev)
102102
return !dev->power.disable_depth;
103103
}
104104

105-
static inline bool pm_runtime_callbacks_present(struct device *dev)
105+
static inline bool pm_runtime_has_no_callbacks(struct device *dev)
106106
{
107-
return !dev->power.no_callbacks;
107+
return dev->power.no_callbacks;
108108
}
109109

110110
static inline void pm_runtime_mark_last_busy(struct device *dev)

0 commit comments

Comments
 (0)