Skip to content

Commit

Permalink
drivers: led: led_pwm: Fix PM callback error logging
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dennisgr102 authored and carlescufi committed Oct 20, 2023
1 parent 30b8d4c commit 78b4735
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/led/led_pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static int led_pwm_pm_action(const struct device *dev,

err = pm_device_action_run(led->dev, action);
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);
}
}

Expand Down

0 comments on commit 78b4735

Please sign in to comment.