Browse Source

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>
pull/40502/head
Gerard Marull-Paretas 4 years ago committed by Carles Cufí
parent
commit
f4417dab46
  1. 2
      drivers/gpio/gpio_stm32.c
  2. 8
      drivers/timer/sys_clock_init.c
  3. 8
      include/device.h
  4. 2
      samples/bluetooth/hci_spi/src/main.c
  5. 2
      samples/bluetooth/hci_uart/src/main.c

2
drivers/gpio/gpio_stm32.c

@ -717,6 +717,6 @@ static int gpio_stm32_afio_init(const struct device *dev) @@ -717,6 +717,6 @@ static int gpio_stm32_afio_init(const struct device *dev)
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 */

8
drivers/timer/sys_clock_init.c

@ -30,12 +30,6 @@ int __weak sys_clock_driver_init(const struct device *dev) @@ -30,12 +30,6 @@ int __weak sys_clock_driver_init(const struct device *dev)
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)
{
}
@ -48,5 +42,5 @@ void __weak sys_clock_disable(void) @@ -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);

8
include/device.h

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

2
samples/bluetooth/hci_spi/src/main.c

@ -279,7 +279,7 @@ static int hci_spi_init(const struct device *unused) @@ -279,7 +279,7 @@ static int hci_spi_init(const struct device *unused)
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);
void main(void)

2
samples/bluetooth/hci_uart/src/main.c

@ -343,7 +343,7 @@ static int hci_uart_init(const struct device *unused) @@ -343,7 +343,7 @@ static int hci_uart_init(const struct device *unused)
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);
void main(void)

Loading…
Cancel
Save