[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b7fb59a9-989e-42b9-ac72-71f353854812@lunn.ch>
Date: Thu, 14 Nov 2024 03:56:25 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Joey Lu <a0987203069@...il.com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org, mcoquelin.stm32@...il.com,
richardcochran@...il.com, alexandre.torgue@...s.st.com,
joabreu@...opsys.com, ychuang3@...oton.com, schung@...oton.com,
yclu4@...oton.com, linux-arm-kernel@...ts.infradead.org,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, openbmc@...ts.ozlabs.org,
linux-stm32@...md-mailman.stormreply.com
Subject: Re: [PATCH v2 3/3] net: stmmac: dwmac-nuvoton: Add dwmac support for
MA35 family
> + 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
Powered by blists - more mailing lists