Skip to contentSkip to conversation

mdio_bus: revert inadvertent error code change

PATCH In review Helmut Grohne 2 participants 2 messages Nov 22, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mdio_bus: revert inadvertent error code change

The fixed commit inadvertently changes the error code from ENOTSUPP to ENOSYS. Doing so breaks (among other things) probing of macb, which returns -ENOTSUPP as it is now returned from mdiobus_register_reset.

Fixes 1d4639567d97 ("mdio_bus: Fix PTR_ERR applied after initialization to constant")
---
 drivers/net/phy/mdio_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/mdio_bus.c +1 -1
index 35876562e32a..dbacb0031877 100644
@@ -65,7 +65,7 @@ static int mdiobus_register_reset(struct mdio_device *mdiodev)
 		reset = devm_reset_control_get_exclusive(&mdiodev->dev,
 							 "phy");
 	if (IS_ERR(reset)) {
-		if (PTR_ERR(reset) == -ENOENT || PTR_ERR(reset) == -ENOSYS)
+		if (PTR_ERR(reset) == -ENOENT || PTR_ERR(reset) == -ENOTSUPP)
 			reset = NULL;
 		else
 			return PTR_ERR(reset);
Signature · 1 line
2.20.1
maintainer
#1 lore raw

From: Helmut Grohne <[email protected]>
Date: Fri, 22 Nov 2019 10:17:13 +0100

Quoted 6 lines

The fixed commit inadvertently changes the error code from ENOTSUPP to ENOSYS. Doing so breaks (among other things) probing of macb, which returns -ENOTSUPP as it is now returned from mdiobus_register_reset.

Fixes 1d4639567d97 ("mdio_bus: Fix PTR_ERR applied after initialization to constant")

You should always generate networking bug fixes against the networking GIT tree, which had you done you would have seen that this bug is fixed there already.

Thank you.