From dbbbf75ef4224521e7937555fd79d50908249359 Mon Sep 17 00:00:00 2001 From: Chad Monroe Date: Mon, 24 Aug 2026 14:22:31 -0700 Subject: [PATCH] mediatek: leds-smartrg: propagate i2c errors from blink_set srg_led_set_pulse() returns !cbyte regardless of whether the i2c writes succeeded, reporting successful pattern offload for a failed bus transaction. Return the i2c error instead; a non-zero return makes the LED core fall back to software blinking, which recovers the pattern once the bus is healthy again. Signed-off-by: Chad Monroe Link: https://github.com/openwrt/openwrt/pull/24354 Signed-off-by: Jonas Jelonek --- .../linux/mediatek/files/drivers/leds/leds-smartrg-system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/linux/mediatek/files/drivers/leds/leds-smartrg-system.c b/target/linux/mediatek/files/drivers/leds/leds-smartrg-system.c index 1c4157ae997..78c937e1f8e 100644 --- a/target/linux/mediatek/files/drivers/leds/leds-smartrg-system.c +++ b/target/linux/mediatek/files/drivers/leds/leds-smartrg-system.c @@ -89,7 +89,10 @@ srg_led_set_pulse(struct led_classdev *led_cdev, } mutex_unlock(&sysled_ctrl->lock); - return !cbyte; + if (ret) + return ret; + + return cbyte ? 0 : 1; } static int