aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/dsa/microchip/ksz_common.h
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2023-09-22 15:31:07 +0200
committerPaolo Abeni <pabeni@redhat.com>2023-10-03 13:51:02 +0200
commite5de2ad163e7df2c2af7d262ee9dec682f580444 (patch)
tree9f6e48ec7953e475b3c1a0b9e326ce6105f2f63a /drivers/net/dsa/microchip/ksz_common.h
parentnet: dsa: tag_ksz: Extend ksz9477_xmit() for HSR frame duplication (diff)
downloadwireguard-linux-e5de2ad163e7df2c2af7d262ee9dec682f580444.tar.xz
wireguard-linux-e5de2ad163e7df2c2af7d262ee9dec682f580444.zip
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>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz_common.h')
-rw-r--r--drivers/net/dsa/microchip/ksz_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index d180c8a34e27..07c7723dbc37 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -212,6 +212,7 @@ enum ksz_chip_id {
};
enum ksz_regs {
+ REG_SW_MAC_ADDR,
REG_IND_CTRL_0,
REG_IND_DATA_8,
REG_IND_DATA_CHECK,