Skip to content

Commit eafb1a8

Browse files
Zijun Hugregkh
authored andcommitted
driver core: Put device attribute @wakeup_last_time_ms and its show() together
Move location of dpm_sysfs_wakeup_change_owner() a bit to - Put device attribute @wakeup_last_time_ms and its show() together. - Put two different instances of dpm_sysfs_wakeup_change_owner() together. That will make better code layout. Signed-off-by: Zijun Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f87f132 commit eafb1a8

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/base/power/sysfs.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,6 @@ static ssize_t wakeup_last_time_ms_show(struct device *dev,
509509
return sysfs_emit(buf, "%lld\n", msec);
510510
}
511511

512-
static inline int dpm_sysfs_wakeup_change_owner(struct device *dev, kuid_t kuid,
513-
kgid_t kgid)
514-
{
515-
if (dev->power.wakeup && dev->power.wakeup->dev)
516-
return device_change_owner(dev->power.wakeup->dev, kuid, kgid);
517-
return 0;
518-
}
519-
520512
static DEVICE_ATTR_RO(wakeup_last_time_ms);
521513

522514
#ifdef CONFIG_PM_AUTOSLEEP
@@ -541,6 +533,15 @@ static ssize_t wakeup_prevent_sleep_time_ms_show(struct device *dev,
541533

542534
static DEVICE_ATTR_RO(wakeup_prevent_sleep_time_ms);
543535
#endif /* CONFIG_PM_AUTOSLEEP */
536+
537+
static inline int dpm_sysfs_wakeup_change_owner(struct device *dev, kuid_t kuid,
538+
kgid_t kgid)
539+
{
540+
if (dev->power.wakeup && dev->power.wakeup->dev)
541+
return device_change_owner(dev->power.wakeup->dev, kuid, kgid);
542+
return 0;
543+
}
544+
544545
#else /* CONFIG_PM_SLEEP */
545546
static inline int dpm_sysfs_wakeup_change_owner(struct device *dev, kuid_t kuid,
546547
kgid_t kgid)

0 commit comments

Comments
 (0)