drivers: led_pwm: Fix power management action callback

A single PWM driver can be used for multiple LED numbers. In that
case -EALREADY may be reported. It should be ignored.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
This commit is contained in:
Marek Pieta 2021-10-27 13:08:44 +02:00 committed by Anas Nashif
commit 07b9e4e992

View file

@ -140,7 +140,7 @@ static int led_pwm_pm_control(const struct device *dev,
}
err = pm_device_state_set(led_pwm->dev, state);
if (err) {
if (err && (err != -EALREADY)) {
LOG_ERR("Cannot switch PWM %p power state", led_pwm->dev);
}
}