[PATCH 2/4] net: stmmac: dwc-qos: Add FSD EQoS support

Sriranjani P sriranjani.p at samsung.com
Tue Nov 15 22:24:47 PST 2022



> -----Original Message-----
> From: Andrew Lunn [mailto:andrew at lunn.ch]
> Sent: 04 November 2022 20:55
> To: Sriranjani P <sriranjani.p at samsung.com>
> Cc: peppe.cavallaro at st.com; alexandre.torgue at foss.st.com;
> joabreu at synopsys.com; davem at davemloft.net; edumazet at google.com;
> kuba at kernel.org; pabeni at redhat.com; mcoquelin.stm32 at gmail.com;
> richardcochran at gmail.com; netdev at vger.kernel.org; linux-stm32 at st-md-
> mailman.stormreply.com; linux-arm-kernel at lists.infradead.org; linux-
> kernel at vger.kernel.org; Chandrasekar R <rcsekar at samsung.com>; Suresh
> Siddha <ssiddha at tesla.com>
> Subject: Re: [PATCH 2/4] net: stmmac: dwc-qos: Add FSD EQoS support
> 
> > +static int dwc_eqos_setup_rxclock(struct platform_device *pdev) {
> > +	struct device_node *np = pdev->dev.of_node;
> > +
> > +	if (np && of_property_read_bool(np, "rx-clock-mux")) {
> > +		unsigned int reg, val;
> > +		struct regmap *syscon =
> syscon_regmap_lookup_by_phandle(np,
> > +			"rx-clock-mux");
> > +
> > +		if (IS_ERR(syscon)) {
> > +			dev_err(&pdev->dev, "couldn't get the rx-clock-mux
> syscon!\n");
> > +			return PTR_ERR(syscon);
> > +		}
> > +
> > +		if (of_property_read_u32_index(np, "rx-clock-mux", 1,
> &reg)) {
> > +			dev_err(&pdev->dev, "couldn't get the rx-clock-mux
> reg. offset!\n");
> > +			return -EINVAL;
> > +		}
> > +
> > +		if (of_property_read_u32_index(np, "rx-clock-mux", 2,
> &val)) {
> > +			dev_err(&pdev->dev, "couldn't get the rx-clock-mux
> reg. val!\n");
> > +			return -EINVAL;
> > +		}
> > +
> > +		regmap_write(syscon, reg, val);
> 
> This appears to be one of those binds which allows any magic value to be
> placed into any register. That is not how DT should be used.
[Sriranjani P] Will fix in the next version.
> 
>    Andrew
[Sriranjani P] Thank you for the review comment.




More information about the linux-arm-kernel mailing list