Skip to content

Commit

Permalink
of: mdio: Refactor of_get_phy_id()
Browse files Browse the repository at this point in the history
With the introduction of fwnode_get_phy_id(), refactor of_get_phy_id()
to use fwnode equivalent.

Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Acked-by: Grant Likely <grant.likely@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Calvin Johnson authored and David S. Miller committed Jun 11, 2021
1 parent 114dea6 commit cf99686
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions drivers/net/mdio/of_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,7 @@ MODULE_LICENSE("GPL");
* ethernet-phy-idAAAA.BBBB */
static int of_get_phy_id(struct device_node *device, u32 *phy_id)
{
struct property *prop;
const char *cp;
unsigned int upper, lower;

of_property_for_each_string(device, "compatible", prop, cp) {
if (sscanf(cp, "ethernet-phy-id%4x.%4x", &upper, &lower) == 2) {
*phy_id = ((upper & 0xFFFF) << 16) | (lower & 0xFFFF);
return 0;
}
}
return -EINVAL;
return fwnode_get_phy_id(of_fwnode_handle(device), phy_id);
}

static struct mii_timestamper *of_find_mii_timestamper(struct device_node *node)
Expand Down

0 comments on commit cf99686

Please sign in to comment.