net: dsa: remove copy of master ethtool_ops

There is no need to store a copy of the master ethtool ops, storing the
original pointer in DSA and the new one in the master netdev itself is
enough.

In the meantime, set orig_ethtool_ops to NULL when restoring the master
ethtool ops and check the presence of the master original ethtool ops as
well as its needed functions before calling them.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vivien Didelot
2017-09-19 11:56:57 -04:00
committed by David S. Miller
parent 69e33b2754
commit f561986659
3 changed files with 15 additions and 13 deletions

View File

@@ -188,7 +188,6 @@ struct dsa_port {
/*
* Original copy of the master netdev ethtool_ops
*/
struct ethtool_ops ethtool_ops;
const struct ethtool_ops *orig_ethtool_ops;
};