pm: device: move device busy APIs to pm subsystem

The following device busy APIs:

- device_busy_set()
- device_busy_clear()
- device_busy_check()
- device_any_busy_check()

were used for device PM, so they have been moved to the pm subsystem.
This means they are now prefixed with `pm_` and are defined in
`pm/device.h`.

If device PM is not enabled dummy functions are now provided that do
nothing or return `-ENOSYS`, meaning that the functionality is not
available.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-05-31 15:24:34 +02:00 committed by Anas Nashif
commit 70322853a8
11 changed files with 112 additions and 119 deletions

View file

@ -24,7 +24,7 @@ void main(void)
printk("Device ready\n");
/* Don't let the system power off / low power this device */
device_busy_set(led.port);
pm_device_busy_set(led.port);
while (true) {
gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);