From 54ce77ec2b9128f2226c375b4d53f20e191906fc Mon Sep 17 00:00:00 2001 From: Dennis Grijalva Date: Fri, 6 Oct 2023 09:56:07 -0700 Subject: [PATCH] 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. (cherry picked from commit 78b4735e07fee8f8b420e774536fb59a6cce9ab3) Original-Signed-off-by: Dennis Grijalva GitOrigin-RevId: 78b4735e07fee8f8b420e774536fb59a6cce9ab3 Change-Id: I09a79d560aeb33c00f46aeed647b57dd5d1652f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4962262 Tested-by: Fabio Baltieri Reviewed-by: Al Semjonovs Reviewed-by: Fabio Baltieri Tested-by: Al Semjonovs Commit-Queue: Fabio Baltieri --- drivers/led/led_pwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/led/led_pwm.c b/drivers/led/led_pwm.c index 72cb616a6e5..7a860ec97b7 100644 --- a/drivers/led/led_pwm.c +++ b/drivers/led/led_pwm.c @@ -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); } }