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.

(cherry picked from commit 78b4735)

Original-Signed-off-by: Dennis Grijalva <dennisgrijalva@meta.com>
GitOrigin-RevId: 78b4735
Change-Id: I09a79d560aeb33c00f46aeed647b57dd5d1652f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4962262
Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: Al Semjonovs <asemjonovs@google.com>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
  • Loading branch information
dennisgr102 authored and Chromeos LUCI committed Oct 23, 2023
1 parent d05722e commit 54ce77e
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 54ce77e

Please sign in to comment.