pm: device: remove usage of ctrl_command

The callback is now invoked to set the device PM state in all cases, so
the usage of ctrl_command is redundant.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-06-07 18:27:39 +02:00 committed by Anas Nashif
commit da0ff4ae46
37 changed files with 319 additions and 509 deletions

View file

@ -322,15 +322,11 @@ static int pwm_nrfx_pm_control(const struct device *dev,
enum pm_device_state *state)
{
int err = 0;
enum pm_device_state curr_state;
if (ctrl_command == PM_DEVICE_STATE_SET) {
enum pm_device_state curr_state;
(void)pm_device_state_get(dev, &curr_state);
if (*state != current_state) {
err = pwm_nrfx_set_power_state(*state, current_state,
dev);
}
(void)pm_device_state_get(dev, &curr_state);
if (*state != current_state) {
err = pwm_nrfx_set_power_state(*state, current_state, dev);
}
return err;