Thread (16 messages) 16 messages, 3 authors, 2022-11-16

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

From: Sriranjani P <hidden>
Date: 2022-11-16 06:29:44
Also in: lkml, netdev

-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch]
Sent: 04 November 2022 20:55
To: Sriranjani P <redacted>
Cc: peppe.cavallaro@st.com; alexandre.torgue@foss.st.com;
joabreu@synopsys.com; davem@davemloft.net; edumazet@google.com;
kuba@kernel.org; pabeni@redhat.com; mcoquelin.stm32@gmail.com;
richardcochran@gmail.com; netdev@vger.kernel.org; linux-stm32@st-md-
mailman.stormreply.com; linux-arm-kernel@lists.infradead.org; linux-
kernel@vger.kernel.org; Chandrasekar R [off-list ref]; Suresh
Siddha [off-list ref]
Subject: Re: [PATCH 2/4] net: stmmac: dwc-qos: Add FSD EQoS support
quoted
+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,
quoted
+			"rx-clock-mux");
+
+		if (IS_ERR(syscon)) {
+			dev_err(&pdev->dev, "couldn't get the rx-clock-mux
syscon!\n");
quoted
+			return PTR_ERR(syscon);
+		}
+
+		if (of_property_read_u32_index(np, "rx-clock-mux", 1,
&reg)) {
quoted
+			dev_err(&pdev->dev, "couldn't get the rx-clock-mux
reg. offset!\n");
quoted
+			return -EINVAL;
+		}
+
+		if (of_property_read_u32_index(np, "rx-clock-mux", 2,
&val)) {
quoted
+			dev_err(&pdev->dev, "couldn't get the rx-clock-mux
reg. val!\n");
quoted
+			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.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help