drivers: led: led_pwm: Fix PM callback error logging

If the underlying PWM device does not have a PM callback,
the PWM LED driver will flood the console with error logs.
The change ignores the error if there is no PM callback
for the PWM device.

Signed-off-by: Dennis Grijalva <dennisgrijalva@meta.com>
This commit is contained in:
Dennis Grijalva 2023-10-06 09:56:07 -07:00 committed by Carles Cufí
parent 30b8d4ca99
commit 78b4735e07

View file

@ -116,7 +116,7 @@ static int led_pwm_pm_action(const struct device *dev,
err = pm_device_action_run(led->dev, action); err = pm_device_action_run(led->dev, action);
if (err && (err != -EALREADY)) { if (err && (err != -EALREADY)) {
LOG_ERR("Cannot switch PWM %p power state", led->dev); LOG_DBG("Cannot switch PWM %p power state (err = %d)", led->dev, err);
} }
} }