pm: device_runtime: Fix return values
Return 0 in cases where the request does not trigger a device state change, only incremented or to decremented the reference count. Fixes #37821 Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
36c73da2f5
commit
93ae6e930a
1 changed files with 6 additions and 0 deletions
|
@ -109,8 +109,14 @@ static int pm_device_request(const struct device *dev,
|
|||
|
||||
if (state == PM_DEVICE_STATE_ACTIVE) {
|
||||
dev->pm->usage++;
|
||||
if (dev->pm->usage > 1) {
|
||||
goto out_unlock;
|
||||
}
|
||||
} else {
|
||||
dev->pm->usage--;
|
||||
if (dev->pm->usage > 0) {
|
||||
goto out_unlock;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue