Thread (9 messages) 9 messages, 4 authors, 2024-11-14

Re: [PATCH v2 3/3] net: stmmac: dwmac-nuvoton: Add dwmac support for MA35 family

flat view

From: Andrew Lunn <andrew@lunn.ch>
Date: 2024-11-14 02:56:40
Also in: linux-arm-kernel, linux-devicetree, lkml, openbmc

quoted hunk ↗ jump to hunk
+	if (of_property_read_u32(dev->of_node, "tx-internal-delay-ps", &arg)) {
+		tx_delay = 0; /* Default value is 0 */
+	} else {
+		if (arg > 0 && arg <= 2000) {
+			tx_delay = (arg == 2000) ? 0xF : (arg / PATHDLY_DEC);
+			dev_dbg(dev, "Set Tx path delay to 0x%x\n", tx_delay);
+		} else {
+			tx_delay = 0;
+			dev_err(dev, "Invalid Tx path delay argument. Setting to default.\n");
+		}
+	}
The device tree binding says that only [0, 2000] are valid. You should
enforce this here, return -EINVAL of any other value.

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help