summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBevan Weiss2025-08-18 08:12:57 +0000
committerRobert Marko2025-08-21 09:22:11 +0000
commit00c16754cd367fbd052f96bcdca66dcfffe54121 (patch)
tree306f9de0c7473e81ad5363474b4a7fbb316952e4
parent5d44b115f1fef40a6b023d098056d8affbe029ae (diff)
downloadopenwrt-00c16754cd367fbd052f96bcdca66dcfffe54121.tar.gz
realtek: RTL930x led_set count error message tidy up + dev_ print fixups
Whilst testing Hasivo s1100wp-8gt-se LED configuration, several error messages were presented which didn't indicate which led_set they were referencing, nor what the value was that caused the invalid configuration. Migrate to use dev_ print messages for this function. And tidy up both when the error message is reported (don't show it when an led_set isn't in the DTS) and what details the message presents. Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com> Link: https://github.com/openwrt/openwrt/pull/19791 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c
index f6a5affb43..c84ed6cca0 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c
@@ -2244,12 +2244,12 @@ static void rtl930x_set_distribution_algorithm(int group, int algoidx, u32 algom
static void rtl930x_led_init(struct rtl838x_switch_priv *priv)
{
struct device_node *node;
+ struct device *dev = priv->dev;
u32 pm = 0;
- pr_debug("%s called\n", __func__);
node = of_find_compatible_node(NULL, NULL, "realtek,rtl9300-leds");
if (!node) {
- pr_debug("%s No compatible LED node found\n", __func__);
+ dev_dbg(dev, "No compatible LED node found\n");
return;
}
@@ -2271,10 +2271,14 @@ static void rtl930x_led_init(struct rtl838x_switch_priv *priv)
sprintf(set_name, "led_set%d", set);
leds_in_this_set = of_property_count_u32_elems(node, set_name);
- if (leds_in_this_set == 0 || leds_in_this_set > sizeof(set_config)) {
- pr_err("%s led_set configuration invalid skipping over this set\n", __func__);
+ if (leds_in_this_set <= 0 || leds_in_this_set > sizeof(set_config)) {
+ if (leds_in_this_set != -EINVAL) {
+ dev_err(dev, "%s invalid, skipping this set, leds_in_this_set=%d, should be (0, %d]\n",
+ set_name, leds_in_this_set, sizeof(set_config));
+ }
continue;
}
+ dev_info(dev, "%s has %d LEDs configured\n", set_name, leds_in_this_set);
if (of_property_read_u32_array(node, set_name, set_config, leds_in_this_set)) {
break;
@@ -2323,7 +2327,7 @@ static void rtl930x_led_init(struct rtl838x_switch_priv *priv)
sw_w32(pm, RTL930X_LED_PORT_COMBO_MASK_CTRL);
for (int i = 0; i < 24; i++)
- pr_debug("%s %08x: %08x\n",__func__, 0xbb00cc00 + i * 4, sw_r32(0xcc00 + i * 4));
+ dev_dbg(dev, "%08x: %08x\n", 0xbb00cc00 + i * 4, sw_r32(0xcc00 + i * 4));
}
const struct rtl838x_reg rtl930x_reg = {