net: dsa: qca8k: drop port_sts from qca8k_priv
Port_sts is a thing of the past for this driver. It was something present on the initial implementation of this driver and parts of the original struct were dropped over time. Using an array of int to store if a port is enabled or not to handle PM operation seems overkill. Switch and use a simple u8 to store the port status where each bit correspond to a port. (bit is set port is enabled, bit is not set, port is disabled) Also add some comments to better describe why we need to track port status. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
69fd055957
commit
2b8fd87af7
@@ -324,10 +324,6 @@ enum qca8k_mid_cmd {
|
||||
QCA8K_MIB_CAST = 3,
|
||||
};
|
||||
|
||||
struct ar8xxx_port_status {
|
||||
int enabled;
|
||||
};
|
||||
|
||||
struct qca8k_match_data {
|
||||
u8 id;
|
||||
bool reduced_package;
|
||||
@@ -388,11 +384,14 @@ struct qca8k_priv {
|
||||
u8 mirror_rx;
|
||||
u8 mirror_tx;
|
||||
u8 lag_hash_mode;
|
||||
/* Each bit correspond to a port. This switch can support a max of 7 port.
|
||||
* Bit 1: port enabled. Bit 0: port disabled.
|
||||
*/
|
||||
u8 port_enabled_map;
|
||||
bool legacy_phy_port_mapping;
|
||||
struct qca8k_ports_config ports_config;
|
||||
struct regmap *regmap;
|
||||
struct mii_bus *bus;
|
||||
struct ar8xxx_port_status port_sts[QCA8K_NUM_PORTS];
|
||||
struct dsa_switch *ds;
|
||||
struct mutex reg_mutex;
|
||||
struct device *dev;
|
||||
|
||||
Reference in New Issue
Block a user