Skip to content

Commit 41f7351

Browse files
computersforpeacerafaeljw
authored andcommitted
PM: runtime: Make pm_runtime_barrier() return void
No callers check the return code, and that's a good thing. Doing so would be racy and unhelpful. Drop the return code entirely, so we don't make anyone think about its complexities. Signed-off-by: Brian Norris <briannorris@chromium.org> Tested-by: Guenter Roeck <linux@roeck-us.net> Link: https://patch.msgid.link/20251202193129.1411419-2-briannorris@chromium.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 3df2470 commit 41f7351

3 files changed

Lines changed: 6 additions & 18 deletions

File tree

Documentation/power/runtime_pm.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,13 +443,11 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
443443
necessary to execute the subsystem-level resume callback for the device
444444
to satisfy that request, otherwise 0 is returned
445445

446-
`int pm_runtime_barrier(struct device *dev);`
446+
`void pm_runtime_barrier(struct device *dev);`
447447
- check if there's a resume request pending for the device and resume it
448448
(synchronously) in that case, cancel any other pending runtime PM requests
449449
regarding it and wait for all runtime PM operations on it in progress to
450-
complete; returns 1 if there was a resume request pending and it was
451-
necessary to execute the subsystem-level resume callback for the device to
452-
satisfy that request, otherwise 0 is returned
450+
complete
453451

454452
`void pm_suspend_ignore_children(struct device *dev, bool enable);`
455453
- set/unset the power.ignore_children flag of the device

drivers/base/power/runtime.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,30 +1467,20 @@ static void __pm_runtime_barrier(struct device *dev)
14671467
* Next, make sure that all pending requests for the device have been flushed
14681468
* from pm_wq and wait for all runtime PM operations involving the device in
14691469
* progress to complete.
1470-
*
1471-
* Return value:
1472-
* 1, if there was a resume request pending and the device had to be woken up,
1473-
* 0, otherwise
14741470
*/
1475-
int pm_runtime_barrier(struct device *dev)
1471+
void pm_runtime_barrier(struct device *dev)
14761472
{
1477-
int retval = 0;
1478-
14791473
pm_runtime_get_noresume(dev);
14801474
spin_lock_irq(&dev->power.lock);
14811475

14821476
if (dev->power.request_pending
1483-
&& dev->power.request == RPM_REQ_RESUME) {
1477+
&& dev->power.request == RPM_REQ_RESUME)
14841478
rpm_resume(dev, 0);
1485-
retval = 1;
1486-
}
14871479

14881480
__pm_runtime_barrier(dev);
14891481

14901482
spin_unlock_irq(&dev->power.lock);
14911483
pm_runtime_put_noidle(dev);
1492-
1493-
return retval;
14941484
}
14951485
EXPORT_SYMBOL_GPL(pm_runtime_barrier);
14961486

include/linux/pm_runtime.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extern int pm_runtime_get_if_active(struct device *dev);
7676
extern int pm_runtime_get_if_in_use(struct device *dev);
7777
extern int pm_schedule_suspend(struct device *dev, unsigned int delay);
7878
extern int __pm_runtime_set_status(struct device *dev, unsigned int status);
79-
extern int pm_runtime_barrier(struct device *dev);
79+
extern void pm_runtime_barrier(struct device *dev);
8080
extern bool pm_runtime_block_if_disabled(struct device *dev);
8181
extern void pm_runtime_unblock(struct device *dev);
8282
extern void pm_runtime_enable(struct device *dev);
@@ -284,7 +284,7 @@ static inline int pm_runtime_get_if_active(struct device *dev)
284284
}
285285
static inline int __pm_runtime_set_status(struct device *dev,
286286
unsigned int status) { return 0; }
287-
static inline int pm_runtime_barrier(struct device *dev) { return 0; }
287+
static inline void pm_runtime_barrier(struct device *dev) {}
288288
static inline bool pm_runtime_block_if_disabled(struct device *dev) { return true; }
289289
static inline void pm_runtime_unblock(struct device *dev) {}
290290
static inline void pm_runtime_enable(struct device *dev) {}

0 commit comments

Comments
 (0)