Skip to content

Commit fa2bfea

Browse files
committed
PM: sleep: core: Rename dev_pm_smart_suspend_and_suspended()
Because all callers of dev_pm_smart_suspend_and_suspended use it only for checking whether or not to skip driver suspend callbacks for a device, rename it to dev_pm_skip_suspend() in analogy with dev_pm_skip_resume(). No functional impact. Suggested-by: Alan Stern <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Alan Stern <[email protected]> Acked-by: Bjorn Helgaas <[email protected]>
1 parent 76c70cb commit fa2bfea

File tree

6 files changed

+19
-20
lines changed

6 files changed

+19
-20
lines changed

drivers/acpi/acpi_lpss.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ static int acpi_lpss_do_suspend_late(struct device *dev)
10411041
{
10421042
int ret;
10431043

1044-
if (dev_pm_smart_suspend_and_suspended(dev))
1044+
if (dev_pm_skip_suspend(dev))
10451045
return 0;
10461046

10471047
ret = pm_generic_suspend_late(dev);
@@ -1169,7 +1169,7 @@ static int acpi_lpss_poweroff_late(struct device *dev)
11691169
{
11701170
struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
11711171

1172-
if (dev_pm_smart_suspend_and_suspended(dev))
1172+
if (dev_pm_skip_suspend(dev))
11731173
return 0;
11741174

11751175
if (pdata->dev_desc->resume_from_noirq)
@@ -1182,7 +1182,7 @@ static int acpi_lpss_poweroff_noirq(struct device *dev)
11821182
{
11831183
struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
11841184

1185-
if (dev_pm_smart_suspend_and_suspended(dev))
1185+
if (dev_pm_skip_suspend(dev))
11861186
return 0;
11871187

11881188
if (pdata->dev_desc->resume_from_noirq) {

drivers/acpi/device_pm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ int acpi_subsys_suspend_late(struct device *dev)
10841084
{
10851085
int ret;
10861086

1087-
if (dev_pm_smart_suspend_and_suspended(dev))
1087+
if (dev_pm_skip_suspend(dev))
10881088
return 0;
10891089

10901090
ret = pm_generic_suspend_late(dev);
@@ -1100,7 +1100,7 @@ int acpi_subsys_suspend_noirq(struct device *dev)
11001100
{
11011101
int ret;
11021102

1103-
if (dev_pm_smart_suspend_and_suspended(dev))
1103+
if (dev_pm_skip_suspend(dev))
11041104
return 0;
11051105

11061106
ret = pm_generic_suspend_noirq(dev);
@@ -1213,7 +1213,7 @@ static int acpi_subsys_poweroff_late(struct device *dev)
12131213
{
12141214
int ret;
12151215

1216-
if (dev_pm_smart_suspend_and_suspended(dev))
1216+
if (dev_pm_skip_suspend(dev))
12171217
return 0;
12181218

12191219
ret = pm_generic_poweroff_late(dev);
@@ -1229,7 +1229,7 @@ static int acpi_subsys_poweroff_late(struct device *dev)
12291229
*/
12301230
static int acpi_subsys_poweroff_noirq(struct device *dev)
12311231
{
1232-
if (dev_pm_smart_suspend_and_suspended(dev))
1232+
if (dev_pm_skip_suspend(dev))
12331233
return 0;
12341234

12351235
return pm_generic_poweroff_noirq(dev);

drivers/base/power/main.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,7 @@ static void dpm_watchdog_clear(struct dpm_watchdog *wd)
567567
*
568568
* Return:
569569
* - %false if the transition under way is RESTORE.
570-
* - The return value of dev_pm_smart_suspend_and_suspended() if the transition
571-
* under way is THAW.
570+
* - Return value of dev_pm_skip_suspend() if the transition under way is THAW.
572571
* - The logical negation of %power.must_resume otherwise (that is, when the
573572
* transition under way is RESUME).
574573
*/
@@ -578,7 +577,7 @@ bool dev_pm_skip_resume(struct device *dev)
578577
return false;
579578

580579
if (pm_transition.event == PM_EVENT_THAW)
581-
return dev_pm_smart_suspend_and_suspended(dev);
580+
return dev_pm_skip_suspend(dev);
582581

583582
return !dev->power.must_resume;
584583
}
@@ -624,7 +623,7 @@ static int device_resume_noirq(struct device *dev, pm_message_t state, bool asyn
624623
*/
625624
if (skip_resume)
626625
pm_runtime_set_suspended(dev);
627-
else if (dev_pm_smart_suspend_and_suspended(dev))
626+
else if (dev_pm_skip_suspend(dev))
628627
pm_runtime_set_active(dev);
629628

630629
if (dev->pm_domain) {
@@ -1223,7 +1222,7 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool a
12231222
if (callback)
12241223
goto Run;
12251224

1226-
if (dev_pm_smart_suspend_and_suspended(dev))
1225+
if (dev_pm_skip_suspend(dev))
12271226
goto Skip;
12281227

12291228
if (dev->driver && dev->driver->pm) {
@@ -1415,7 +1414,7 @@ static int __device_suspend_late(struct device *dev, pm_message_t state, bool as
14151414
if (callback)
14161415
goto Run;
14171416

1418-
if (dev_pm_smart_suspend_and_suspended(dev))
1417+
if (dev_pm_skip_suspend(dev))
14191418
goto Skip;
14201419

14211420
if (dev->driver && dev->driver->pm) {
@@ -2003,7 +2002,7 @@ void device_pm_check_callbacks(struct device *dev)
20032002
spin_unlock_irq(&dev->power.lock);
20042003
}
20052004

2006-
bool dev_pm_smart_suspend_and_suspended(struct device *dev)
2005+
bool dev_pm_skip_suspend(struct device *dev)
20072006
{
20082007
return dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND) &&
20092008
pm_runtime_status_suspended(dev);

drivers/pci/hotplug/pciehp_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static int pciehp_suspend(struct pcie_device *dev)
275275
* If the port is already runtime suspended we can keep it that
276276
* way.
277277
*/
278-
if (dev_pm_smart_suspend_and_suspended(&dev->port->dev))
278+
if (dev_pm_skip_suspend(&dev->port->dev))
279279
return 0;
280280

281281
pciehp_disable_interrupt(dev);

drivers/pci/pci-driver.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ static int pci_pm_suspend(struct device *dev)
776776

777777
static int pci_pm_suspend_late(struct device *dev)
778778
{
779-
if (dev_pm_smart_suspend_and_suspended(dev))
779+
if (dev_pm_skip_suspend(dev))
780780
return 0;
781781

782782
pci_fixup_device(pci_fixup_suspend, to_pci_dev(dev));
@@ -789,7 +789,7 @@ static int pci_pm_suspend_noirq(struct device *dev)
789789
struct pci_dev *pci_dev = to_pci_dev(dev);
790790
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
791791

792-
if (dev_pm_smart_suspend_and_suspended(dev))
792+
if (dev_pm_skip_suspend(dev))
793793
return 0;
794794

795795
if (pci_has_legacy_pm_support(pci_dev))
@@ -1126,7 +1126,7 @@ static int pci_pm_poweroff(struct device *dev)
11261126

11271127
static int pci_pm_poweroff_late(struct device *dev)
11281128
{
1129-
if (dev_pm_smart_suspend_and_suspended(dev))
1129+
if (dev_pm_skip_suspend(dev))
11301130
return 0;
11311131

11321132
pci_fixup_device(pci_fixup_suspend, to_pci_dev(dev));
@@ -1139,7 +1139,7 @@ static int pci_pm_poweroff_noirq(struct device *dev)
11391139
struct pci_dev *pci_dev = to_pci_dev(dev);
11401140
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
11411141

1142-
if (dev_pm_smart_suspend_and_suspended(dev))
1142+
if (dev_pm_skip_suspend(dev))
11431143
return 0;
11441144

11451145
if (pci_has_legacy_pm_support(pci_dev))

include/linux/pm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ extern int pm_generic_poweroff(struct device *dev);
759759
extern void pm_generic_complete(struct device *dev);
760760

761761
extern bool dev_pm_skip_resume(struct device *dev);
762-
extern bool dev_pm_smart_suspend_and_suspended(struct device *dev);
762+
extern bool dev_pm_skip_suspend(struct device *dev);
763763

764764
#else /* !CONFIG_PM_SLEEP */
765765

0 commit comments

Comments
 (0)