Thread (16 messages) 16 messages, 6 authors, 1d ago

Re: [net-next,PATCH 2/2] enetc: Make eMDIO MDC rate configurable from DT

flat view

From: Marek Vasut <marex@nabladev.com>
Date: 2026-10-17 17:32:52
Also in: imx, linux-arm-kernel, linux-devicetree, linuxppc-dev, lkml

On 10/16/26 10:04 PM, Frank Li wrote:

[...]
quoted
+int enetc_mdio_update_mdc_div(struct mii_bus *bus)
+{
+	struct enetc_mdio_priv *mdio_priv = bus->priv;
+	struct device *dev = bus->parent;
+	struct clk *enet_clk;
+	u32 div, mdc_freq;
+
+	if (device_property_read_u32(dev, "clock-frequency", &mdc_freq))
+		return 0;
+
+	enet_clk = devm_clk_get(dev, NULL);
+	if (IS_ERR(enet_clk))
+		return dev_err_probe(dev, PTR_ERR(enet_clk),
+				     "Input clock unknown, not changing MDC frequency\n");
binding said clock is optional. If return failure here, it will block
existing dts, which have not clock property.

should be devm_clk_get_optional()?
Existing DTs are fine, since they don't define clock-frequency property. And whoever wants to define clock-frequency property, they also must provide clock property.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help