Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm: device_runtime: Add missing include to header #66908

Conversation

bjarki-andreasen
Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen commented Dec 23, 2023

The device_runtime header includes references to struct device and k_timeout_t, but only zephyr/device.h is included. k_timeout_t is in zephyr/kernel.h, so it must also be included. Without this include, the following error occurs if the source file happens to not include zephyr/kernel.h before zephyr/pm/device_runtime.h

In file included from /home/private/Documents/trackunit/zephyr_rtc/katja/src/main.c:1:
/home/private/Documents/trackunit/zephyr_rtc/zephyr/include/zephyr/pm/device_runtime.h:144:59: error: unknown type name 'k_timeout_t'
  144 | int pm_device_runtime_put_async(const struct device *dev, k_timeout_t delay);

The device_runtime header includes references to struct device
and k_timeout_t, but only zephyr/device.h is included. k_timeout_t
is in zephyr/kernel, so it must also be included.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
@bjarki-andreasen bjarki-andreasen added the Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. label Dec 23, 2023
@fabiobaltieri fabiobaltieri merged commit ed8578d into zephyrproject-rtos:main Jan 3, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Power Management Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants