Thread (18 messages) 18 messages, 4 authors, 2022-08-27

Re: [PATCH net-next v2 5/7] net: mdiobus: search for PSE nodes by parsing PHY nodes.

flat view

From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2022-08-25 13:11:49
Also in: linux-devicetree, linux-doc, lkml

On Thu, Aug 25, 2022 at 03:02:09PM +0200, Oleksij Rempel wrote:
quoted hunk ↗ jump to hunk
+static struct pse_control *
+fwnode_find_pse_control(struct fwnode_handle *fwnode)
+{
+	struct pse_control *psec;
+	struct device_node *np;
+
+	if (is_acpi_node(fwnode))
+		return NULL;
+
+	np = to_of_node(fwnode);
+	if (!np)
+		return NULL;
Doesn't to_of_node() confirm that the fwnode is a DT node? In other
words, isn't the "is_acpi_node()" entirely redundant?
quoted hunk ↗ jump to hunk
+
+	psec = of_pse_control_get(np);
+	if (IS_ERR_OR_NULL(psec))
+		return NULL;
+
+	return psec;
+}
So fwnode_find_pse_control() returns NULL on error.
quoted hunk ↗ jump to hunk
+	psec = fwnode_find_pse_control(child);
+	if (IS_ERR(psec))
+		return PTR_ERR(psec);
This usage expects it to return an error-pointer.

Clearly, there is some disagreement about what fwnode_find_pse_control()
returns on error.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help