Re: [PATCH v5 net-next 4/5] net: dsa: microchip: move REG_SW_MAC_ADDR to dev->info->regs[]

From: Florian Fainelli
Date: Thu Sep 21 2023 - 15:42:03 EST


On 9/20/23 04:43, Lukasz Majewski wrote:
From: Vladimir Oltean <vladimir.oltean@xxxxxxx>

Defining macros which have the same name but different values is bad
practice, because it makes it hard to avoid code duplication. The same
code does different things, depending on the file it's placed in.
Case in point, we want to access REG_SW_MAC_ADDR from ksz_common.c, but
currently we can't, because we don't know which kszXXXX_reg.h to include
from the common code.

Remove the REG_SW_MAC_ADDR_{0..5} macros from ksz8795_reg.h and
ksz9477_reg.h, and re-add this register offset to the dev->info->regs[]
array.

Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
Signed-off-by: Lukasz Majewski <lukma@xxxxxxx>

Reviewed-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
--
Florian