]> git.itanic.dy.fi Git - linux-stable/commit
net: dsa: microchip: move REG_SW_MAC_ADDR to dev->info->regs[]
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 22 Sep 2023 13:31:07 +0000 (15:31 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 3 Oct 2023 11:51:02 +0000 (13:51 +0200)
commite5de2ad163e7df2c2af7d262ee9dec682f580444
tree9f6e48ec7953e475b3c1a0b9e326ce6105f2f63a
parent5e5db71a92c537ff37149b58bba6a8b2588a46f0
net: dsa: microchip: move REG_SW_MAC_ADDR to dev->info->regs[]

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@nxp.com>
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/microchip/ksz8795_reg.h
drivers/net/dsa/microchip/ksz9477_reg.h
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_common.h