[PATCH net-next v2] net: airoha: simplify WAN device check in airoha_dev_init()

Alexander Lobakin aleksander.lobakin at intel.com
Wed Jun 10 07:14:10 PDT 2026


From: Lorenzo Bianconi <lorenzo at kernel.org>
Date: Wed, 10 Jun 2026 15:25:13 +0200

> airoha_register_gdm_devices() iterates eth->ports[] in order, so GDM2's
> netdev is always registered before GDM3/GDM4. This means the explicit
> check for eth->ports[1] && eth->ports[1]->devs[0] is a redundant
> special-case of what airoha_get_wan_gdm_dev() already covers, since
> GDM2 is always marked as WAN during its own ndo_init.
> Remove the redundant check and rely solely on airoha_get_wan_gdm_dev()
> which handles both the GDM2-present and GDM2-absent cases.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>

Reviewed-by: Alexander Lobakin <aleksander.lobakin at intel.com>

Thanks,
Olek



More information about the linux-arm-kernel mailing list