Thread (7 messages) flat view 7 messages, 3 authors, 2018-10-07

Re: [PATCH V2 net-next 4/5] net: mdio: of: Register discovered MII time stampers.

From: Richard Cochran <richardcochran@gmail.com>
Date: 2018-10-07 19:26:27
Also in: linux-devicetree

On Sun, Oct 07, 2018 at 08:17:54PM +0200, Andrew Lunn wrote:
quoted
quoted
+	if (err == -ENOENT)
+		return NULL;
+	else if (err)
+		return ERR_PTR(err);
+
+	if (args.args_count >= 1)
+		port = args.args[0];
If it's greater than one, than it is an error, and it should be flagged
as such.

The idea looks good though, should of_find_mii_timestamper() somehow be
made conditional to CONFIG_PTP and we should have a stub for when it is
disabled?
Hi Florian

There already is a stub. But register return -EOPNOTSUPP.
The stub returns NULL...
quoted
quoted
+	return register_mii_timestamper(args.np, port);
So this returns EOPNOTUP
NULL...
 
quoted
quoted
 static int of_mdiobus_register_phy(struct mii_bus *mdio,
 				    struct device_node *child, u32 addr)
 {
+	struct mii_timestamper *mii_ts;
 	struct phy_device *phy;
 	bool is_c45;
 	int rc;
 	u32 phy_id;
 
+	mii_ts = of_find_mii_timestamper(child);
+	if (IS_ERR(mii_ts))
+		return PTR_ERR(mii_ts);
+
and this returns EOPNOPTSUPP, so the PHY is not registered :-(
and the phydev.mii_ts field is then set to NULL.

Thanks,
Richard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help