Thread (22 messages) 22 messages, 5 authors, 2026-01-22

Re: [PATCH net-next 3/3] net: stmmac: Add glue layer for Spacemit K3 SoC

From: Yixun Lan <hidden>
Date: 2026-01-20 11:32:21
Also in: linux-arm-kernel, linux-devicetree, linux-riscv, lkml, spacemit

Hi Yao,

On 11:13 Tue 20 Jan     , Yao Zi wrote:
On Tue, Jan 20, 2026 at 12:36:08PM +0800, Inochi Amaoto wrote:
quoted
Adds Spacemit dwmac driver support on the Spacemit K3 SoC.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 +
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
 .../ethernet/stmicro/stmmac/dwmac-spacemit.c  | 224 ++++++++++++++++++
 3 files changed, 237 insertions(+)
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-spacemit.c

...
quoted
+static int spacemit_dwmac_probe(struct platform_device *pdev)
+{
...
quoted
+	of_property_read_u32(pdev->dev.of_node, "tx-internal-delay-ps", &tx_delay);
+	of_property_read_u32(pdev->dev.of_node, "rx-internal-delay-ps", &rx_delay);
According to of.h, of_property_read_u32, which in turn calls
of_property_read_u32_array, could fail with -ENODATA if there's no value
associated with the property. Should the case be handled?
I think it should be safe, see the comment

 *
 * The out_values is modified only if a valid u64 value can be decoded.
 */
static inline int of_property_read_u64_array(const struct device_node *np,
                                             const char *propname,
                                             u64 *out_values, size_t sz)
{
..
if the function fail then it will use default value which assigned already
at initialization stage.

-- 
Yixun Lan (dlan)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help