Skip to contentSkip to conversation

net: dsa: sja1105: Simplify reset handling

PATCH Applied Vladimir Oltean 2 participants 2 messages Nov 12, 2019 – Nov 14, 2019

Subsystems (4)
lore
Share & tools
lore

Vladimir Oltean

author maintainer
#0 lore raw

PATCH 1/1 net: dsa: sja1105: Simplify reset handling

We don't really need 10k species of reset. Remove everything except cold reset which is what is actually used. Too bad the hardware designers couldn't agree to use the same bit field for rev 1 and rev 2, so the (*reset_cmd) function pointer is there to stay.

However let's simplify the prototype and give it a struct dsa_switch (we want to avoid forward-declarations of structures, in this case struct sja1105_private, wherever we can).

---
 drivers/net/dsa/sja1105/sja1105.h     |   2 +-
 drivers/net/dsa/sja1105/sja1105_spi.c | 110 ++++----------------------
 2 files changed, 15 insertions(+), 97 deletions(-)
drivers/net/dsa/sja1105/sja1105.h +1 -1
index 29c7ed60cfdc..d801fc204d19 100644
@@ -78,7 +78,7 @@ struct sja1105_info {
 	const struct sja1105_dynamic_table_ops *dyn_ops;
 	const struct sja1105_table_ops *static_ops;
 	const struct sja1105_regs *regs;
-	int (*reset_cmd)(const void *ctx, const void *data);
+	int (*reset_cmd)(struct dsa_switch *ds);
 	int (*setup_rgmii_delay)(const void *ctx, int port);
 	/* Prototypes from include/net/dsa.h */
 	int (*fdb_add_cmd)(struct dsa_switch *ds, int port,
drivers/net/dsa/sja1105/sja1105_spi.c +14 -96

137 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

From: Vladimir Oltean <[email protected]>
Date: Wed, 13 Nov 2019 00:16:41 +0200

Quoted 10 lines

We don't really need 10k species of reset. Remove everything except cold reset which is what is actually used. Too bad the hardware designers couldn't agree to use the same bit field for rev 1 and rev 2, so the (*reset_cmd) function pointer is there to stay.

However let's simplify the prototype and give it a struct dsa_switch (we want to avoid forward-declarations of structures, in this case struct sja1105_private, wherever we can).

Applied, thank you.