Skip to content

Commit 2a3f347

Browse files
committed
PM: sleep: core: Rename DPM_FLAG_LEAVE_SUSPENDED
Rename DPM_FLAG_LEAVE_SUSPENDED to DPM_FLAG_MAY_SKIP_RESUME which matches its purpose more closely. No functional impact. Suggested-by: Alan Stern <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Wolfram Sang <[email protected]> # for I2C Acked-by: Alan Stern <[email protected]> Acked-by: Bjorn Helgaas <[email protected]>
1 parent e075155 commit 2a3f347

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Documentation/driver-api/pm/devices.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ general.]
803803
However, it often is desirable to leave devices in suspend after system
804804
transitions to the working state, especially if those devices had been in
805805
runtime suspend before the preceding system-wide suspend (or analogous)
806-
transition. Device drivers can use the ``DPM_FLAG_LEAVE_SUSPENDED`` flag to
806+
transition. Device drivers can use the ``DPM_FLAG_MAY_SKIP_RESUME`` flag to
807807
indicate to the PM core (and middle-layer code) that they prefer the specific
808808
devices handled by them to be left suspended and they have no problems with
809809
skipping their system-wide resume callbacks for this reason. Whether or not the
@@ -825,7 +825,7 @@ device really can be left in suspend.
825825

826826
For devices whose "noirq", "late" and "early" driver callbacks are invoked
827827
directly by the PM core, all of the system-wide resume callbacks are skipped if
828-
``DPM_FLAG_LEAVE_SUSPENDED`` is set and the device is in runtime suspend during
828+
``DPM_FLAG_MAY_SKIP_RESUME`` is set and the device is in runtime suspend during
829829
the ``suspend_noirq`` (or analogous) phase or the transition under way is a
830830
proper system suspend (rather than anything related to hibernation) and the
831831
device's wakeup settings are suitable for runtime PM (that is, it cannot

Documentation/power/pci.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ into D0 going forward), but if it is in runtime suspend in pci_pm_thaw_noirq(),
10291029
the function will set the power.direct_complete flag for it (to make the PM core
10301030
skip the subsequent "thaw" callbacks for it) and return.
10311031

1032-
Setting the DPM_FLAG_LEAVE_SUSPENDED flag means that the driver prefers the
1032+
Setting the DPM_FLAG_MAY_SKIP_RESUME flag means that the driver prefers the
10331033
device to be left in suspend after system-wide transitions to the working state.
10341034
This flag is checked by the PM core, but the PCI bus type informs the PM core
10351035
which devices may be left in suspend from its perspective (that happens during

drivers/acpi/acpi_tad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ static int acpi_tad_probe(struct platform_device *pdev)
624624
*/
625625
device_init_wakeup(dev, true);
626626
dev_pm_set_driver_flags(dev, DPM_FLAG_SMART_SUSPEND |
627-
DPM_FLAG_LEAVE_SUSPENDED);
627+
DPM_FLAG_MAY_SKIP_RESUME);
628628
/*
629629
* The platform bus type layer tells the ACPI PM domain powers up the
630630
* device, so set the runtime PM status of it to "active".

drivers/base/power/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool a
12471247
* to be skipped.
12481248
*/
12491249
if (atomic_read(&dev->power.usage_count) > 1 ||
1250-
!(dev_pm_test_driver_flags(dev, DPM_FLAG_LEAVE_SUSPENDED) &&
1250+
!(dev_pm_test_driver_flags(dev, DPM_FLAG_MAY_SKIP_RESUME) &&
12511251
dev->power.may_skip_resume))
12521252
dev->power.must_resume = true;
12531253

drivers/i2c/busses/i2c-designware-platdrv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,12 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
357357
if (dev->flags & ACCESS_NO_IRQ_SUSPEND) {
358358
dev_pm_set_driver_flags(&pdev->dev,
359359
DPM_FLAG_SMART_PREPARE |
360-
DPM_FLAG_LEAVE_SUSPENDED);
360+
DPM_FLAG_MAY_SKIP_RESUME);
361361
} else {
362362
dev_pm_set_driver_flags(&pdev->dev,
363363
DPM_FLAG_SMART_PREPARE |
364364
DPM_FLAG_SMART_SUSPEND |
365-
DPM_FLAG_LEAVE_SUSPENDED);
365+
DPM_FLAG_MAY_SKIP_RESUME);
366366
}
367367

368368
/* The code below assumes runtime PM to be disabled. */

include/linux/pm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ struct pm_subsys_data {
547547
* NO_DIRECT_COMPLETE: Do not apply direct-complete optimization to the device.
548548
* SMART_PREPARE: Check the return value of the driver's ->prepare callback.
549549
* SMART_SUSPEND: No need to resume the device from runtime suspend.
550-
* LEAVE_SUSPENDED: Avoid resuming the device during system resume if possible.
550+
* MAY_SKIP_RESUME: Avoid resuming the device during system resume if possible.
551551
*
552552
* Setting SMART_PREPARE instructs bus types and PM domains which may want
553553
* system suspend/resume callbacks to be skipped for the device to return 0 from
@@ -562,13 +562,13 @@ struct pm_subsys_data {
562562
* invocations of the ->suspend_late and ->suspend_noirq callbacks provided by
563563
* the driver if they decide to leave the device in runtime suspend.
564564
*
565-
* Setting LEAVE_SUSPENDED informs the PM core and middle-layer code that the
565+
* Setting MAY_SKIP_RESUME informs the PM core and middle-layer code that the
566566
* driver prefers the device to be left in suspend after system resume.
567567
*/
568568
#define DPM_FLAG_NO_DIRECT_COMPLETE BIT(0)
569569
#define DPM_FLAG_SMART_PREPARE BIT(1)
570570
#define DPM_FLAG_SMART_SUSPEND BIT(2)
571-
#define DPM_FLAG_LEAVE_SUSPENDED BIT(3)
571+
#define DPM_FLAG_MAY_SKIP_RESUME BIT(3)
572572

573573
struct dev_pm_info {
574574
pm_message_t power_state;

0 commit comments

Comments
 (0)