diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2023-09-22 16:31:07 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-10-03 14:51:02 +0300 |
commit | e5de2ad163e7df2c2af7d262ee9dec682f580444 (patch) | |
tree | 9f6e48ec7953e475b3c1a0b9e326ce6105f2f63a /drivers/net/dsa/microchip/ksz_common.h | |
parent | 5e5db71a92c537ff37149b58bba6a8b2588a46f0 (diff) | |
download | linux-e5de2ad163e7df2c2af7d262ee9dec682f580444.tar.xz |
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.h | 1 |
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, |