Skip to content

Conversation

@JordanYates
Copy link
Contributor

Returning -ENOTSUP (and logging a LOG_ERR) is not the correct behaviour if there is no enable GPIO. The fact there was no work to do does not make the result an error.

From the docs for pm_device_runtime_get

 * @retval 0 If it succeeds. In case device runtime PM is not enabled or
 *  not available this function will be a no-op and will also return 0.

Returning `-ENOTSUP` (and logging a `LOG_ERR`) is not the correct
behaviour if there is no enable GPIO. The fact there was no work to do
does not make the result an error.

From the docs for `pm_device_runtime_get`
```
 * @RetVal 0 If it succeeds. In case device runtime PM is not enabled or
 *  not available this function will be a no-op and will also return 0.
```

Signed-off-by: Jordan Yates <jordan@embeint.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants