Skip to content

Commit

Permalink
pm: device_runtime: Fix tracing in runtime_enable
Browse files Browse the repository at this point in the history
Move around SYS_PORT_FUNC_ENTER and change a early return
in a way that when this function is called it will generate
tracing for entering / leaving this function.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
  • Loading branch information
Flavio Ceolin authored and henrikbrixandersen committed Feb 6, 2024
1 parent 5970244 commit 75fd75c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions subsys/pm/device_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,13 @@ int pm_device_runtime_enable(const struct device *dev)
int ret = 0;
struct pm_device *pm = dev->pm;

SYS_PORT_TRACING_FUNC_ENTER(pm, device_runtime_enable, dev);

if (pm == NULL) {
return -ENOTSUP;
ret = -ENOTSUP;
goto end;
}

SYS_PORT_TRACING_FUNC_ENTER(pm, device_runtime_enable, dev);

if (pm_device_state_is_locked(dev)) {
ret = -EPERM;
goto end;
Expand Down

0 comments on commit 75fd75c

Please sign in to comment.