From 9e7d545bb440f28bfaa6823fbffb1152b116e7fa Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 9 Jun 2021 13:09:42 +0200 Subject: [PATCH] pm: device: remove ctrl_command callback argument The ctrl_command is not used anymore, so remove it from the callback signature. Signed-off-by: Gerard Marull-Paretas --- drivers/display/display_st7735r.c | 2 +- drivers/display/display_st7789v.c | 4 ++-- drivers/entropy/entropy_cc13xx_cc26xx.c | 1 - drivers/ethernet/eth_mcux.c | 1 - drivers/flash/spi_flash_at45.c | 1 - drivers/gpio/gpio_dw.c | 1 - drivers/gpio/gpio_stm32.c | 1 - drivers/i2c/i2c_cc13xx_cc26xx.c | 1 - drivers/i2c/i2c_nrfx_twi.c | 3 +-- drivers/i2c/i2c_nrfx_twim.c | 1 - drivers/interrupt_controller/intc_arcv2_irq_unit.c | 1 - drivers/interrupt_controller/intc_ioapic.c | 1 - drivers/interrupt_controller/intc_loapic.c | 1 - drivers/led/led_pwm.c | 2 +- drivers/pwm/pwm_nrfx.c | 4 +--- drivers/sensor/apds9960/apds9960.c | 1 - drivers/sensor/bme280/bme280.c | 3 +-- drivers/sensor/bmp388/bmp388.c | 1 - drivers/sensor/bq274xx/bq274xx.c | 4 ++-- drivers/sensor/fdc2x1x/fdc2x1x.c | 1 - drivers/sensor/lis2mdl/lis2mdl.c | 4 ++-- drivers/sensor/qdec_nrfx/qdec_nrfx.c | 1 - drivers/sensor/sgp40/sgp40.c | 4 +--- drivers/sensor/vcnl4040/vcnl4040.c | 1 - drivers/serial/uart_cc13xx_cc26xx.c | 1 - drivers/serial/uart_npcx.c | 4 ++-- drivers/serial/uart_nrfx_uart.c | 1 - drivers/serial/uart_nrfx_uarte.c | 1 - drivers/serial/uart_stm32.c | 3 +-- drivers/spi/spi_cc13xx_cc26xx.c | 1 - drivers/spi/spi_nrfx_spi.c | 3 +-- drivers/spi/spi_nrfx_spim.c | 1 - drivers/timer/sys_clock_init.c | 1 - include/device.h | 2 +- include/drivers/timer/system_timer.h | 2 +- include/pm/device.h | 5 ----- samples/subsys/pm/device_pm/src/dummy_driver.c | 1 - samples/subsys/pm/device_pm/src/dummy_parent.c | 1 - subsys/pm/device.c | 2 +- tests/net/pm/src/main.c | 2 +- tests/subsys/pm/device_runtime/src/dummy_driver.c | 1 - tests/subsys/pm/power_mgmt/src/dummy_driver.c | 1 - 42 files changed, 20 insertions(+), 58 deletions(-) diff --git a/drivers/display/display_st7735r.c b/drivers/display/display_st7735r.c index 467621d7554..7f2d0f08adc 100644 --- a/drivers/display/display_st7735r.c +++ b/drivers/display/display_st7735r.c @@ -499,7 +499,7 @@ static int st7735r_enter_sleep(struct st7735r_data *data) return st7735r_transmit(data, ST7735R_CMD_SLEEP_IN, NULL, 0); } -static int st7735r_pm_control(const struct device *dev, uint32_t ctrl_command, +static int st7735r_pm_control(const struct device *dev, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/display/display_st7789v.c b/drivers/display/display_st7789v.c index 6cf6da46db0..fe6f1c45658 100644 --- a/drivers/display/display_st7789v.c +++ b/drivers/display/display_st7789v.c @@ -401,8 +401,8 @@ static void st7789v_enter_sleep(struct st7789v_data *data) st7789v_transmit(data, ST7789V_CMD_SLEEP_IN, NULL, 0); } -static int st7789v_pm_control(const struct device *dev, uint32_t ctrl_command, - enum pm_device_state *state) +static int st7789v_pm_control(const struct device *dev, + enum pm_device_state *state) { struct st7789v_data *data = (struct st7789v_data *)dev->data; diff --git a/drivers/entropy/entropy_cc13xx_cc26xx.c b/drivers/entropy/entropy_cc13xx_cc26xx.c index 4095823b1df..a6311d48032 100644 --- a/drivers/entropy/entropy_cc13xx_cc26xx.c +++ b/drivers/entropy/entropy_cc13xx_cc26xx.c @@ -291,7 +291,6 @@ static int entropy_cc13xx_cc26xx_set_power_state(const struct device *dev, } static int entropy_cc13xx_cc26xx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/ethernet/eth_mcux.c b/drivers/ethernet/eth_mcux.c index b779a06d706..bec0d6fe433 100644 --- a/drivers/ethernet/eth_mcux.c +++ b/drivers/ethernet/eth_mcux.c @@ -185,7 +185,6 @@ static void eth_mcux_phy_enter_reset(struct eth_context *context); void eth_mcux_phy_stop(struct eth_context *context); static int eth_mcux_device_pm_control(const struct device *dev, - uint32_t command, enum pm_device_state *state) { struct eth_context *eth_ctx = (struct eth_context *)dev->data; diff --git a/drivers/flash/spi_flash_at45.c b/drivers/flash/spi_flash_at45.c index 9dd107d7842..3c63f1d19bd 100644 --- a/drivers/flash/spi_flash_at45.c +++ b/drivers/flash/spi_flash_at45.c @@ -625,7 +625,6 @@ static int spi_flash_at45_init(const struct device *dev) #if IS_ENABLED(CONFIG_PM_DEVICE) static int spi_flash_at45_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { const struct spi_flash_at45_config *dev_config = get_dev_config(dev); diff --git a/drivers/gpio/gpio_dw.c b/drivers/gpio/gpio_dw.c index 931757d2ad0..be3b92091b3 100644 --- a/drivers/gpio/gpio_dw.c +++ b/drivers/gpio/gpio_dw.c @@ -442,7 +442,6 @@ static inline int gpio_dw_resume_from_suspend_port(const struct device *port) * the *context may include IN data or/and OUT data */ static int gpio_dw_device_ctrl(const struct device *port, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/gpio/gpio_stm32.c b/drivers/gpio/gpio_stm32.c index 29f095e31af..9510a940fec 100644 --- a/drivers/gpio/gpio_stm32.c +++ b/drivers/gpio/gpio_stm32.c @@ -595,7 +595,6 @@ static int gpio_stm32_set_power_state(const struct device *dev, } static int gpio_stm32_pm_device_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/i2c/i2c_cc13xx_cc26xx.c b/drivers/i2c/i2c_cc13xx_cc26xx.c index 4326bc9ba6f..46f952877c2 100644 --- a/drivers/i2c/i2c_cc13xx_cc26xx.c +++ b/drivers/i2c/i2c_cc13xx_cc26xx.c @@ -365,7 +365,6 @@ static int i2c_cc13xx_cc26xx_set_power_state(const struct device *dev, } static int i2c_cc13xx_cc26xx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/i2c/i2c_nrfx_twi.c b/drivers/i2c/i2c_nrfx_twi.c index efa0cf1a7bb..7a897403c8e 100644 --- a/drivers/i2c/i2c_nrfx_twi.c +++ b/drivers/i2c/i2c_nrfx_twi.c @@ -217,8 +217,7 @@ static int init_twi(const struct device *dev) #ifdef CONFIG_PM_DEVICE static int twi_nrfx_pm_control(const struct device *dev, - uint32_t ctrl_command, - enum pm_device_state *state) + enum pm_device_state *state) { int ret = 0; enum pm_device_state curr_state; diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index dcb6b037995..2e8bcbcbc74 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -255,7 +255,6 @@ static int init_twim(const struct device *dev) #ifdef CONFIG_PM_DEVICE static int twim_nrfx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/interrupt_controller/intc_arcv2_irq_unit.c b/drivers/interrupt_controller/intc_arcv2_irq_unit.c index 5df1dc73c6c..4c02ad588c7 100644 --- a/drivers/interrupt_controller/intc_arcv2_irq_unit.c +++ b/drivers/interrupt_controller/intc_arcv2_irq_unit.c @@ -175,7 +175,6 @@ static int arc_v2_irq_unit_resume(const struct device *dev) * @return operation result */ static int arc_v2_irq_unit_device_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/interrupt_controller/intc_ioapic.c b/drivers/interrupt_controller/intc_ioapic.c index 31cd89bd199..ec2d219839f 100644 --- a/drivers/interrupt_controller/intc_ioapic.c +++ b/drivers/interrupt_controller/intc_ioapic.c @@ -310,7 +310,6 @@ int ioapic_resume_from_suspend(const struct device *port) */ __pinned_func static int ioapic_device_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/interrupt_controller/intc_loapic.c b/drivers/interrupt_controller/intc_loapic.c index 7809e071491..7c03ab58141 100644 --- a/drivers/interrupt_controller/intc_loapic.c +++ b/drivers/interrupt_controller/intc_loapic.c @@ -409,7 +409,6 @@ int loapic_resume(const struct device *port) */ __pinned_func static int loapic_device_ctrl(const struct device *port, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/led/led_pwm.c b/drivers/led/led_pwm.c index 4fbad06146c..465dfe2754d 100644 --- a/drivers/led/led_pwm.c +++ b/drivers/led/led_pwm.c @@ -142,7 +142,7 @@ static int led_pwm_pm_set_state(const struct device *dev, return 0; } -static int led_pwm_pm_control(const struct device *dev, uint32_t ctrl_command, +static int led_pwm_pm_control(const struct device *dev, enum pm_device_state *state) { return led_pwm_pm_set_state(dev, *state); diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index e8b9db0f8f3..2a9b2152670 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -318,7 +318,6 @@ static int pwm_nrfx_set_power_state(enum pm_device_state new_state, } static int pwm_nrfx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int err = 0; @@ -334,10 +333,9 @@ static int pwm_nrfx_pm_control(const struct device *dev, #define PWM_NRFX_PM_CONTROL(idx) \ static int pwm_##idx##_nrfx_pm_control(const struct device *dev, \ - uint32_t ctrl_command, \ enum pm_device_state *state) \ { \ - return pwm_nrfx_pm_control(dev, ctrl_command, state) \ + return pwm_nrfx_pm_control(dev, state) \ } #else diff --git a/drivers/sensor/apds9960/apds9960.c b/drivers/sensor/apds9960/apds9960.c index 32d4d4bb8c2..95defc1f453 100644 --- a/drivers/sensor/apds9960/apds9960.c +++ b/drivers/sensor/apds9960/apds9960.c @@ -409,7 +409,6 @@ static int apds9960_init_interrupt(const struct device *dev) #ifdef CONFIG_PM_DEVICE static int apds9960_device_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { const struct apds9960_config *config = dev->config; diff --git a/drivers/sensor/bme280/bme280.c b/drivers/sensor/bme280/bme280.c index faa439f8dc9..49d4f79f0fb 100644 --- a/drivers/sensor/bme280/bme280.c +++ b/drivers/sensor/bme280/bme280.c @@ -410,8 +410,7 @@ static int bme280_chip_init(const struct device *dev) } #ifdef CONFIG_PM_DEVICE -int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command, - enum pm_device_state *state) +int bme280_pm_ctrl(const struct device *dev, enum pm_device_state *state) { int ret = 0; enum pm_device_state curr_state; diff --git a/drivers/sensor/bmp388/bmp388.c b/drivers/sensor/bmp388/bmp388.c index eab0041fcd8..f35b6905da4 100644 --- a/drivers/sensor/bmp388/bmp388.c +++ b/drivers/sensor/bmp388/bmp388.c @@ -583,7 +583,6 @@ static int bmp388_set_power_state(const struct device *dev, static int bmp388_device_ctrl( const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/sensor/bq274xx/bq274xx.c b/drivers/sensor/bq274xx/bq274xx.c index e3dc76acde2..5fd2932f72e 100644 --- a/drivers/sensor/bq274xx/bq274xx.c +++ b/drivers/sensor/bq274xx/bq274xx.c @@ -731,8 +731,8 @@ static int bq274xx_exit_shutdown_mode(const struct device *dev) return 0; } -static int bq274xx_pm_control(const struct device *dev, uint32_t ctrl_command, - enum pm_device_state *state) +static int bq274xx_pm_control(const struct device *dev, + enum pm_device_state *state) { int ret = 0; struct bq274xx_data *data = dev->data; diff --git a/drivers/sensor/fdc2x1x/fdc2x1x.c b/drivers/sensor/fdc2x1x/fdc2x1x.c index 34eff52ef71..c7f710fa7e1 100644 --- a/drivers/sensor/fdc2x1x/fdc2x1x.c +++ b/drivers/sensor/fdc2x1x/fdc2x1x.c @@ -535,7 +535,6 @@ static int fdc2x1x_set_pm_state(const struct device *dev, } static int fdc2x1x_device_pm_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { struct fdc2x1x_data *data = dev->data; diff --git a/drivers/sensor/lis2mdl/lis2mdl.c b/drivers/sensor/lis2mdl/lis2mdl.c index 64af656ef70..7da0500ac42 100644 --- a/drivers/sensor/lis2mdl/lis2mdl.c +++ b/drivers/sensor/lis2mdl/lis2mdl.c @@ -475,8 +475,8 @@ static int lis2mdl_set_power_state(struct lis2mdl_data *lis2mdl, return status; } -static int lis2mdl_pm_control(const struct device *dev, uint32_t ctrl_command, - enum pm_device_state *state) +static int lis2mdl_pm_control(const struct device *dev, + enum pm_device_state *state) { struct lis2mdl_data *lis2mdl = dev->data; const struct lis2mdl_config *const config = dev->config; diff --git a/drivers/sensor/qdec_nrfx/qdec_nrfx.c b/drivers/sensor/qdec_nrfx/qdec_nrfx.c index 01be74ede35..09c9598a224 100644 --- a/drivers/sensor/qdec_nrfx/qdec_nrfx.c +++ b/drivers/sensor/qdec_nrfx/qdec_nrfx.c @@ -240,7 +240,6 @@ static int qdec_nrfx_pm_set_state(struct qdec_nrfx_data *data, } static int qdec_nrfx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { struct qdec_nrfx_data *data = &qdec_nrfx_data; diff --git a/drivers/sensor/sgp40/sgp40.c b/drivers/sensor/sgp40/sgp40.c index 55c803c2f3a..7e9c5cee97f 100644 --- a/drivers/sensor/sgp40/sgp40.c +++ b/drivers/sensor/sgp40/sgp40.c @@ -218,9 +218,7 @@ static int sgp40_set_power_state(const struct device *dev, return 0; } -static int sgp40_pm_ctrl(const struct device *dev, - uint32_t ctrl_command, - enum pm_device_state *state) +static int sgp40_pm_ctrl(const struct device *dev, enum pm_device_state *state) { return sgp40_set_power_state(dev, *state); } diff --git a/drivers/sensor/vcnl4040/vcnl4040.c b/drivers/sensor/vcnl4040/vcnl4040.c index 199d630d195..96d34dd6380 100644 --- a/drivers/sensor/vcnl4040/vcnl4040.c +++ b/drivers/sensor/vcnl4040/vcnl4040.c @@ -219,7 +219,6 @@ static int vcnl4040_ambient_setup(const struct device *dev) #ifdef CONFIG_PM_DEVICE static int vcnl4040_device_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/serial/uart_cc13xx_cc26xx.c b/drivers/serial/uart_cc13xx_cc26xx.c index c442616e803..a4d81e850da 100644 --- a/drivers/serial/uart_cc13xx_cc26xx.c +++ b/drivers/serial/uart_cc13xx_cc26xx.c @@ -441,7 +441,6 @@ static int uart_cc13xx_cc26xx_set_power_state(const struct device *dev, } static int uart_cc13xx_cc26xx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/serial/uart_npcx.c b/drivers/serial/uart_npcx.c index e8b984991fe..b3b8a911a68 100644 --- a/drivers/serial/uart_npcx.c +++ b/drivers/serial/uart_npcx.c @@ -457,8 +457,8 @@ static inline int uart_npcx_set_power_state(const struct device *dev, } /* Implements the device power management control functionality */ -static int uart_npcx_pm_control(const struct device *dev, uint32_t ctrl_command, - enum pm_device_state *state) +static int uart_npcx_pm_control(const struct device *dev, + enum pm_device_state *state) { return uart_npcx_set_power_state(dev, *state); } diff --git a/drivers/serial/uart_nrfx_uart.c b/drivers/serial/uart_nrfx_uart.c index 150296af43b..4486d70afde 100644 --- a/drivers/serial/uart_nrfx_uart.c +++ b/drivers/serial/uart_nrfx_uart.c @@ -1159,7 +1159,6 @@ static void uart_nrfx_set_power_state(const struct device *dev, } static int uart_nrfx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { enum pm_device_state current_state; diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index b9349d46f49..474c5860fc8 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -1922,7 +1922,6 @@ static void uarte_nrfx_set_power_state(const struct device *dev, } static int uarte_nrfx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { enum pm_device_state curr_state; diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index 02e013b1f51..7d65a762820 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -1460,8 +1460,7 @@ static int uart_stm32_set_power_state(const struct device *dev, * @return 0 */ static int uart_stm32_pm_control(const struct device *dev, - uint32_t ctrl_command, - enum pm_device_state *state) + enum pm_device_state *state) { enum pm_device_state curr_state; diff --git a/drivers/spi/spi_cc13xx_cc26xx.c b/drivers/spi/spi_cc13xx_cc26xx.c index aececb716b9..ede932ef592 100644 --- a/drivers/spi/spi_cc13xx_cc26xx.c +++ b/drivers/spi/spi_cc13xx_cc26xx.c @@ -248,7 +248,6 @@ static int spi_cc13xx_cc26xx_set_power_state(const struct device *dev, } static int spi_cc13xx_cc26xx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/spi/spi_nrfx_spi.c b/drivers/spi/spi_nrfx_spi.c index 07ffe2e49d9..d87bfafb91d 100644 --- a/drivers/spi/spi_nrfx_spi.c +++ b/drivers/spi/spi_nrfx_spi.c @@ -278,8 +278,7 @@ static int init_spi(const struct device *dev) #ifdef CONFIG_PM_DEVICE static int spi_nrfx_pm_control(const struct device *dev, - uint32_t ctrl_command, - enum pm_device_state *state) + enum pm_device_state *state) { int ret = 0; struct spi_nrfx_data *data = get_dev_data(dev); diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index a8f966fd744..0695a31dd73 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -325,7 +325,6 @@ static int init_spim(const struct device *dev) #ifdef CONFIG_PM_DEVICE static int spim_nrfx_pm_control(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { int ret = 0; diff --git a/drivers/timer/sys_clock_init.c b/drivers/timer/sys_clock_init.c index 8bbdef75227..7e892e06d6a 100644 --- a/drivers/timer/sys_clock_init.c +++ b/drivers/timer/sys_clock_init.c @@ -31,7 +31,6 @@ int __weak sys_clock_driver_init(const struct device *dev) } int __weak sys_clock_device_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { return -ENOSYS; diff --git a/include/device.h b/include/device.h index 6c69afdcbf2..de8ac099a36 100644 --- a/include/device.h +++ b/include/device.h @@ -384,7 +384,7 @@ struct device { const device_handle_t *const handles; #ifdef CONFIG_PM_DEVICE /** Power Management function */ - int (*pm_control)(const struct device *dev, uint32_t command, + int (*pm_control)(const struct device *dev, enum pm_device_state *state); /** Pointer to device instance power management data */ struct pm_device * const pm; diff --git a/include/drivers/timer/system_timer.h b/include/drivers/timer/system_timer.h index 4ec49442206..61b7a24c4fe 100644 --- a/include/drivers/timer/system_timer.h +++ b/include/drivers/timer/system_timer.h @@ -46,7 +46,7 @@ extern int sys_clock_driver_init(const struct device *dev); * management. It is a weak symbol that will be implemented as a noop * if undefined in the clock driver. */ -extern int clock_device_ctrl(const struct device *dev, uint32_t ctrl_command, +extern int clock_device_ctrl(const struct device *dev, enum pm_device_state *state); /** diff --git a/include/pm/device.h b/include/pm/device.h index eec9d265e1b..313e00fb4b8 100644 --- a/include/pm/device.h +++ b/include/pm/device.h @@ -62,11 +62,6 @@ enum pm_device_state { PM_DEVICE_STATE_SUSPENDING, }; -/** Device PM set state control command. */ -#define PM_DEVICE_STATE_SET 0 -/** Device PM get state control command. */ -#define PM_DEVICE_STATE_GET 1 - /** @brief Device PM flags. */ enum pm_device_flag { /** Indicate if the device is busy or not. */ diff --git a/samples/subsys/pm/device_pm/src/dummy_driver.c b/samples/subsys/pm/device_pm/src/dummy_driver.c index 16bd3fac3cc..8e2f4616b1f 100644 --- a/samples/subsys/pm/device_pm/src/dummy_driver.c +++ b/samples/subsys/pm/device_pm/src/dummy_driver.c @@ -87,7 +87,6 @@ static int dummy_close(const struct device *dev) } static int dummy_device_pm_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { if (*state == PM_DEVICE_STATE_ACTIVE) { diff --git a/samples/subsys/pm/device_pm/src/dummy_parent.c b/samples/subsys/pm/device_pm/src/dummy_parent.c index 16368c63360..8a9f57d8e62 100644 --- a/samples/subsys/pm/device_pm/src/dummy_parent.c +++ b/samples/subsys/pm/device_pm/src/dummy_parent.c @@ -25,7 +25,6 @@ static int dummy_transfer(const struct device *dev, uint32_t cmd, } static int dummy_parent_pm_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { if (*state == PM_DEVICE_STATE_ACTIVE) { diff --git a/subsys/pm/device.c b/subsys/pm/device.c index 80b34b9cd77..936541a1afb 100644 --- a/subsys/pm/device.c +++ b/subsys/pm/device.c @@ -137,7 +137,7 @@ int pm_device_state_set(const struct device *dev, return -ENOSYS; } - ret = dev->pm_control(dev, PM_DEVICE_STATE_SET, &device_power_state); + ret = dev->pm_control(dev, &device_power_state); if (ret < 0) { return ret; } diff --git a/tests/net/pm/src/main.c b/tests/net/pm/src/main.c index 7cb46a9990e..9abb81cd68a 100644 --- a/tests/net/pm/src/main.c +++ b/tests/net/pm/src/main.c @@ -21,7 +21,7 @@ struct fake_dev_context { struct net_if *iface; }; -static int fake_dev_pm_control(const struct device *dev, uint32_t command, +static int fake_dev_pm_control(const struct device *dev, enum pm_device_state *state) { struct fake_dev_context *ctx = dev->data; diff --git a/tests/subsys/pm/device_runtime/src/dummy_driver.c b/tests/subsys/pm/device_runtime/src/dummy_driver.c index af7a8081f6a..b91c10c61d6 100644 --- a/tests/subsys/pm/device_runtime/src/dummy_driver.c +++ b/tests/subsys/pm/device_runtime/src/dummy_driver.c @@ -35,7 +35,6 @@ static int dummy_close_sync(const struct device *dev) } static int dummy_device_pm_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { return 0; diff --git a/tests/subsys/pm/power_mgmt/src/dummy_driver.c b/tests/subsys/pm/power_mgmt/src/dummy_driver.c index ecb36052308..7b37346feed 100644 --- a/tests/subsys/pm/power_mgmt/src/dummy_driver.c +++ b/tests/subsys/pm/power_mgmt/src/dummy_driver.c @@ -20,7 +20,6 @@ static int dummy_close(const struct device *dev) } static int dummy_device_pm_ctrl(const struct device *dev, - uint32_t ctrl_command, enum pm_device_state *state) { return 0;