]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: dsa: derive dsa port count and irq mask from cpu port 22068/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Tue, 17 Feb 2026 18:19:22 +0000 (19:19 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 21 Feb 2026 19:33:28 +0000 (20:33 +0100)
Avoid a family_id check and derive the values from the cpu port.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22068
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c

index 0a23329778bd718381c83ff0cf8d665731616a08..23a37f2bcd755fb57520b0d5a81b8e12929400b1 100644 (file)
@@ -1411,8 +1411,6 @@ static int rtl83xx_sw_probe(struct platform_device *pdev)
                priv->cpu_port = RTL838X_CPU_PORT;
                priv->port_mask = 0x1f;
                priv->port_width = 1;
-               priv->irq_mask = 0x0FFFFFFF;
-               priv->ds->num_ports = RTL838X_CPU_PORT + 1;
                priv->fib_entries = 8192;
                priv->ds->num_lag_ids = 8;
                priv->l2_bucket_size = 4;
@@ -1423,8 +1421,6 @@ static int rtl83xx_sw_probe(struct platform_device *pdev)
                priv->cpu_port = RTL839X_CPU_PORT;
                priv->port_mask = 0x3f;
                priv->port_width = 2;
-               priv->irq_mask = 0xFFFFFFFFFFFFFULL;
-               priv->ds->num_ports = RTL839X_CPU_PORT + 1;
                priv->fib_entries = 16384;
                priv->ds->num_lag_ids = 16;
                priv->l2_bucket_size = 4;
@@ -1435,8 +1431,6 @@ static int rtl83xx_sw_probe(struct platform_device *pdev)
                priv->cpu_port = RTL930X_CPU_PORT;
                priv->port_mask = 0x1f;
                priv->port_width = 1;
-               priv->irq_mask = 0x0FFFFFFF;
-               priv->ds->num_ports = RTL930X_CPU_PORT + 1;
                priv->fib_entries = 16384;
                priv->ds->num_lag_ids = 16;
                sw_w32(0, RTL930X_ST_CTRL);
@@ -1448,8 +1442,6 @@ static int rtl83xx_sw_probe(struct platform_device *pdev)
                priv->cpu_port = RTL931X_CPU_PORT;
                priv->port_mask = 0x3f;
                priv->port_width = 2;
-               priv->irq_mask = GENMASK_ULL(priv->cpu_port - 1, 0);
-               priv->ds->num_ports = RTL931X_CPU_PORT + 1;
                priv->fib_entries = 16384;
                priv->ds->num_lag_ids = 16;
                sw_w32(0, RTL931x_ST_CTRL);
@@ -1457,6 +1449,8 @@ static int rtl83xx_sw_probe(struct platform_device *pdev)
                priv->n_mst = 128;
                break;
        }
+       priv->ds->num_ports = priv->cpu_port + 1;
+       priv->irq_mask = GENMASK_ULL(priv->cpu_port - 1, 0);
 
        err = rtl83xx_mdio_probe(priv);
        if (err) {