device: remove PM capability from SYS_DEVICE_DEFINE

The macro already mentions in the docstrings that PM is not supported:

"Invokes DEVICE_DEFINE() with no power management support".

This patch removed the PM entry from the macro and ajusts its uses.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-11-16 16:37:45 +01:00 committed by Carles Cufí
commit f4417dab46
5 changed files with 7 additions and 15 deletions

View file

@ -717,6 +717,6 @@ static int gpio_stm32_afio_init(const struct device *dev)
return 0; return 0;
} }
SYS_DEVICE_DEFINE("gpio_stm32_afio", gpio_stm32_afio_init, NULL, PRE_KERNEL_1, 0); SYS_DEVICE_DEFINE("gpio_stm32_afio", gpio_stm32_afio_init, PRE_KERNEL_1, 0);
#endif /* CONFIG_SOC_SERIES_STM32F1X && !CONFIG_GPIO_STM32_SWJ_ENABLE */ #endif /* CONFIG_SOC_SERIES_STM32F1X && !CONFIG_GPIO_STM32_SWJ_ENABLE */

View file

@ -30,12 +30,6 @@ int __weak sys_clock_driver_init(const struct device *dev)
return 0; return 0;
} }
int __weak sys_clock_device_ctrl(const struct device *dev,
enum pm_device_action action)
{
return -ENOSYS;
}
void __weak sys_clock_set_timeout(int32_t ticks, bool idle) void __weak sys_clock_set_timeout(int32_t ticks, bool idle)
{ {
} }
@ -48,5 +42,5 @@ void __weak sys_clock_disable(void)
{ {
} }
SYS_DEVICE_DEFINE("sys_clock", sys_clock_driver_init, sys_clock_device_ctrl, SYS_DEVICE_DEFINE("sys_clock", sys_clock_driver_init,
PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY); PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);

View file

@ -83,16 +83,14 @@ typedef int16_t device_handle_t;
/** /**
* @def SYS_DEVICE_DEFINE * @def SYS_DEVICE_DEFINE
* *
* @brief Run an initialization function at boot at specified priority, * @brief Run an initialization function at boot at specified priority.
* and define device PM control function.
* *
* @details Invokes DEVICE_DEFINE() with no power management support * @details Invokes DEVICE_DEFINE() with no power management support
* (@p pm_action_cb), no API (@p api_ptr), and a device name derived from * (@p pm_action_cb), no API (@p api_ptr), and a device name derived from
* the @p init_fn name (@p dev_name). * the @p init_fn name (@p dev_name).
*/ */
#define SYS_DEVICE_DEFINE(drv_name, init_fn, pm_action_cb, level, prio) \ #define SYS_DEVICE_DEFINE(drv_name, init_fn, level, prio) \
DEVICE_DEFINE(Z_SYS_NAME(init_fn), drv_name, init_fn, \ DEVICE_DEFINE(Z_SYS_NAME(init_fn), drv_name, init_fn, NULL, \
pm_action_cb, \
NULL, NULL, level, prio, NULL) NULL, NULL, level, prio, NULL)
/** /**

View file

@ -279,7 +279,7 @@ static int hci_spi_init(const struct device *unused)
return 0; return 0;
} }
SYS_DEVICE_DEFINE("hci_spi", hci_spi_init, NULL, SYS_DEVICE_DEFINE("hci_spi", hci_spi_init,
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
void main(void) void main(void)

View file

@ -343,7 +343,7 @@ static int hci_uart_init(const struct device *unused)
return 0; return 0;
} }
SYS_DEVICE_DEFINE("hci_uart", hci_uart_init, NULL, SYS_DEVICE_DEFINE("hci_uart", hci_uart_init,
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
void main(void) void main(void)