Skip to content

Commit 4d7647e

Browse files
committed
Merge: net: backport ethernet-phy-ieee802.3-c45 fixes
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6345 ## Summary of Changes Backport missing fixes for the ethernet-phy-ieee802.3-c45 driver. ## Approved Development Ticket(s) JIRA: https://issues.redhat.com/browse/RHEL-78049 Signed-off-by: Jared Kangas <jkangas@redhat.com> Approved-by: Radu Rendec <rrendec@redhat.com> Approved-by: Aaron Brookner <abrookne@redhat.com> Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Patrick Talbert <ptalbert@redhat.com>
2 parents e53f13c + 62629ce commit 4d7647e

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

drivers/net/mdio/fwnode_mdio.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
#include <linux/acpi.h>
10+
#include <linux/dev_printk.h>
1011
#include <linux/fwnode_mdio.h>
1112
#include <linux/of.h>
1213
#include <linux/phy.h>
@@ -39,6 +40,7 @@ fwnode_find_pse_control(struct fwnode_handle *fwnode)
3940
static struct mii_timestamper *
4041
fwnode_find_mii_timestamper(struct fwnode_handle *fwnode)
4142
{
43+
struct mii_timestamper *mii_ts;
4244
struct of_phandle_args arg;
4345
int err;
4446

@@ -52,10 +54,16 @@ fwnode_find_mii_timestamper(struct fwnode_handle *fwnode)
5254
else if (err)
5355
return ERR_PTR(err);
5456

55-
if (arg.args_count != 1)
56-
return ERR_PTR(-EINVAL);
57+
if (arg.args_count != 1) {
58+
mii_ts = ERR_PTR(-EINVAL);
59+
goto put_node;
60+
}
61+
62+
mii_ts = register_mii_timestamper(arg.np, arg.args[0]);
5763

58-
return register_mii_timestamper(arg.np, arg.args[0]);
64+
put_node:
65+
of_node_put(arg.np);
66+
return mii_ts;
5967
}
6068

6169
int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
@@ -99,7 +107,7 @@ int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
99107
return rc;
100108
}
101109

102-
dev_dbg(&mdio->dev, "registered phy %p fwnode at address %i\n",
110+
dev_dbg(&mdio->dev, "registered phy fwnode %pfw at address %i\n",
103111
child, addr);
104112
return 0;
105113
}
@@ -111,7 +119,7 @@ int fwnode_mdiobus_register_phy(struct mii_bus *bus,
111119
struct mii_timestamper *mii_ts = NULL;
112120
struct pse_control *psec = NULL;
113121
struct phy_device *phy;
114-
bool is_c45 = false;
122+
bool is_c45;
115123
u32 phy_id;
116124
int rc;
117125

@@ -125,11 +133,7 @@ int fwnode_mdiobus_register_phy(struct mii_bus *bus,
125133
goto clean_pse;
126134
}
127135

128-
rc = fwnode_property_match_string(child, "compatible",
129-
"ethernet-phy-ieee802.3-c45");
130-
if (rc >= 0)
131-
is_c45 = true;
132-
136+
is_c45 = fwnode_device_is_compatible(child, "ethernet-phy-ieee802.3-c45");
133137
if (is_c45 || fwnode_get_phy_id(child, &phy_id))
134138
phy = get_phy_device(bus, addr, is_c45);
135139
else

0 commit comments

Comments
 (0)