aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Shtylyov <[email protected]>2020-02-15 23:09:35 +0300
committerDavid S. Miller <[email protected]>2020-02-16 19:44:41 -0800
commitf75ca32403dbf91e20c275719aab705401b9e718 (patch)
treeded1376b3aef5b9d0dabd015e2203ad82020bff4
parent6eaeedc1aa27a423bd89043705eca39215015bb3 (diff)
sh_eth: check sh_eth_cpu_data::cexcr when dumping registers
When adding the sh_eth_cpu_data::cexcr flag I forgot to add the flag check to __sh_eth_get_regs(), causing the non-existing RX packet counter registers to be considered for dumping on the R7S72100 SoC (the register offset sanity check has the final say here)... Fixes: 4c1d45850d5 ("sh_eth: add sh_eth_cpu_data::cexcr flag") Signed-off-by: Sergei Shtylyov <[email protected]> Tested-by: Chris Brandt <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index cd1f5842b131..ae9469c90ae2 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2194,8 +2194,10 @@ static size_t __sh_eth_get_regs(struct net_device *ndev, u32 *buf)
add_reg(FRECR);
add_reg(TSFRCR);
add_reg(TLFRCR);
- add_reg(CERCR);
- add_reg(CEECR);
+ if (cd->cexcr) {
+ add_reg(CERCR);
+ add_reg(CEECR);
+ }
add_reg(MAFCR);
if (cd->rtrate)
add_reg(RTRATE);