Skip to content

Commit 3618bba

Browse files
andy-shevrafaeljw
authored andcommitted
PM: runtime: Make clear what we do when conditions are wrong in rpm_suspend()
rpm_suspend() simple bails out when conditions are wrong. But this is not immediately obvious from the code. Make it clear what we do when conditions are wrong in rpm_suspend(). Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 9cb1fd0 commit 3618bba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/base/power/runtime.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,11 @@ static int rpm_suspend(struct device *dev, int rpmflags)
523523

524524
repeat:
525525
retval = rpm_check_suspend_allowed(dev);
526-
527526
if (retval < 0)
528-
; /* Conditions are wrong. */
527+
goto out; /* Conditions are wrong. */
529528

530529
/* Synchronous suspends are not allowed in the RPM_RESUMING state. */
531-
else if (dev->power.runtime_status == RPM_RESUMING &&
532-
!(rpmflags & RPM_ASYNC))
530+
if (dev->power.runtime_status == RPM_RESUMING && !(rpmflags & RPM_ASYNC))
533531
retval = -EAGAIN;
534532
if (retval)
535533
goto out;

0 commit comments

Comments
 (0)