On Tue, Dec 14, 2021 at 11:44:05PM +0100, Ansuel Smith wrote:
quoted hunk ↗ jump to hunk
+static int qca8k_connect_tag_protocol(struct dsa_switch *ds,
+ enum dsa_tag_protocol proto)
+{
+ struct qca8k_priv *qca8k_priv = ds->priv;
+
+ switch (proto) {
+ case DSA_TAG_PROTO_QCA:
+ struct tag_qca_priv *priv;
Actually this fails to compile:
drivers/net/dsa/qca8k.c: In function ‘qca8k_connect_tag_protocol’:
drivers/net/dsa/qca8k.c:2893:3: error: a label can only be part of a statement and a declaration is not a statement
2893 | struct tag_qca_priv *priv;
| ^~~~~~
make[3]: *** [scripts/Makefile.build:287: drivers/net/dsa/qca8k.o] Error 1
This is what the {} brackets are for.
Also, while you're at this, please name "priv" "tagger_data".
quoted hunk ↗ jump to hunk
+
+ priv = ds->tagger_data;
+
+ mutex_init(&qca8k_priv->mdio_hdr_data.mutex);
+ init_completion(&qca8k_priv->mdio_hdr_data.rw_done);
+
+ priv->rw_reg_ack_handler = qca8k_rw_reg_ack_handler;
+
+ break;
+ default:
+ return -EOPNOTSUPP;
+ }
+
+ return 0;
}