]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: airoha: Rely on net_device pointer in airoha_dev_setup_tc_block signature
authorLorenzo Bianconi <lorenzo@kernel.org>
Sun, 12 Apr 2026 17:13:12 +0000 (19:13 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 13 Apr 2026 23:48:38 +0000 (16:48 -0700)
Remove airoha_gdm_port dependency in airoha_dev_setup_tc_block routine
signature and rely on net_device pointer instead. Please note this patch
does not introduce any logical change and it is a preliminary patch to
support multiple net_devices connected to the GDM3 or GDM4 ports via an
external hw arbiter.

Tested-by: Xuegang Lu <xuegang.lu@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260412-airoha-multi-serdes-preliminary-patch-v1-1-08d5b670ca8f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/airoha/airoha_eth.c

index 8e4b043af4bc35f9bd53f549f3a72f97e7eedfae..a98512e963b5b0bf8d2a481a01a2cfb45d1f816f 100644 (file)
@@ -2687,7 +2687,7 @@ static int airoha_dev_setup_tc_block_cb(enum tc_setup_type type,
        }
 }
 
-static int airoha_dev_setup_tc_block(struct airoha_gdm_port *port,
+static int airoha_dev_setup_tc_block(struct net_device *dev,
                                     struct flow_block_offload *f)
 {
        flow_setup_cb_t *cb = airoha_dev_setup_tc_block_cb;
@@ -2700,12 +2700,12 @@ static int airoha_dev_setup_tc_block(struct airoha_gdm_port *port,
        f->driver_block_list = &block_cb_list;
        switch (f->command) {
        case FLOW_BLOCK_BIND:
-               block_cb = flow_block_cb_lookup(f->block, cb, port->dev);
+               block_cb = flow_block_cb_lookup(f->block, cb, dev);
                if (block_cb) {
                        flow_block_cb_incref(block_cb);
                        return 0;
                }
-               block_cb = flow_block_cb_alloc(cb, port->dev, port->dev, NULL);
+               block_cb = flow_block_cb_alloc(cb, dev, dev, NULL);
                if (IS_ERR(block_cb))
                        return PTR_ERR(block_cb);
 
@@ -2714,7 +2714,7 @@ static int airoha_dev_setup_tc_block(struct airoha_gdm_port *port,
                list_add_tail(&block_cb->driver_list, &block_cb_list);
                return 0;
        case FLOW_BLOCK_UNBIND:
-               block_cb = flow_block_cb_lookup(f->block, cb, port->dev);
+               block_cb = flow_block_cb_lookup(f->block, cb, dev);
                if (!block_cb)
                        return -ENOENT;
 
@@ -2813,7 +2813,7 @@ static int airoha_dev_tc_setup(struct net_device *dev, enum tc_setup_type type,
                return airoha_tc_setup_qdisc_htb(port, type_data);
        case TC_SETUP_BLOCK:
        case TC_SETUP_FT:
-               return airoha_dev_setup_tc_block(port, type_data);
+               return airoha_dev_setup_tc_block(dev, type_data);
        default:
                return -EOPNOTSUPP;
        }