Re: [PATCH net-next v9 02/11] net: dsa: realtek: rtl8365mb: add chip family infrastructure

From: Linus Walleij

Date: Sun Nov 08 2026 - 09:20:55 EST


On Sun, Nov 8, 2026 at 9:07 AM Mieczyslaw Nalewaj <namiltd@xxxxxxxxx> wrote:

> Add enum rtl8365mb_family and struct rtl8365mb_family_info, which holds
> the data shared by all chips of one family: the family id, the port
> count and the init jam table. struct rtl8365mb_chip_info now points to
> it through a family_info member, and all existing chips use the
> RTL8365MB_FAMILY_C instance. rtl8365mb_get_family_info() and
> rtl8365mb_is_d() are declared in a new rtl8365mb.h so that the VLAN
> code can use them too.
>
> Use num_ports from the family info in rtl8365mb_detect() instead of a
> fixed constant, so that a family with a different port count can be
> described by its own entry.
>
> RTL8365MB_FAMILY_D is defined here but no chip uses it yet; it is
> needed by the following patches, which add family D handling for chips
> whose register layout differs from the existing ones.
>
> No functional change.
>
> Tested-by: Gustavo Foletto Mora <gusfmora@xxxxxxxxx>
> Tested-by: Stanislaw Pal <kuncy7@xxxxxxxxx>
> Signed-off-by: Mieczyslaw Nalewaj <namiltd@xxxxxxxxx>

OK that is prettier than the prior solution for sure.
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij