Re: [PATCH net-next 4/5] net/fsl: xgmac_mdio: Support setting the MDC frequency

From: Andrew Lunn
Date: Wed Jan 26 2022 - 09:02:57 EST


> >> + if (device_property_read_u32(dev, "clock-frequency", &priv->mdc_freq))
> >> + return;
> >> +
> >> + priv->enet_clk = devm_clk_get(dev, NULL);
> >> + if (IS_ERR(priv->enet_clk)) {
> >> + dev_err(dev, "Input clock unknown, not changing MDC frequency");
> >
> > Is the clock optional or mandatory?
>
> As the code is now, it is mandatory. I could add some default frequency,
> but I fear that could do more harm than good?

As i said in the reply to the DT patch, it is mandatory if the
"clock-frequency" parameter is present.

> Ok, no worries about regressions for deployed stuff already out there?

It would only cause a regression if a DT blob happened to have a
'clock-frequency' parameter and not clock, which it should not.

Andrew