Thread (31 messages) flat view 31 messages, 4 authors, 2021-10-11

Re: [net-next PATCH v5 05/14] drivers: net: dsa: qca8k: add support for cpu port 6

From: DENG Qingfang <dqfext@gmail.com>
Date: 2021-10-11 04:49:37
Also in: linux-devicetree, lkml

On Mon, Oct 11, 2021 at 03:30:15AM +0200, Ansuel Smith wrote:
quoted hunk ↗ jump to hunk
 static int
 qca8k_parse_port_config(struct qca8k_priv *priv)
 {
@@ -1011,13 +1027,14 @@ static int
 qca8k_setup(struct dsa_switch *ds)
 {
 	struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
+	u8 cpu_port;
cpu_port should be of type int.
 	int ret, i;
 	u32 mask;
 
-	/* Make sure that port 0 is the cpu port */
-	if (!dsa_is_cpu_port(ds, 0)) {
-		dev_err(priv->dev, "port 0 is not the CPU port");
-		return -EINVAL;
+	cpu_port = qca8k_find_cpu_port(ds);
+	if (cpu_port < 0) {
+		dev_err(priv->dev, "No cpu port configured in both cpu port0 and port6");
+		return cpu_port;
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help