Re: [PATCH net-next v4 4/5] stmmac: intel: add phy-mode and fixed-link ACPI _DSD setting support

From: Andrew Lunn
Date: Tue Jun 14 2022 - 15:01:22 EST


> + /* For fixed-link setup, we allow phy-mode setting */
> + fwnode = dev_fwnode(&pdev->dev);
> + if (fwnode) {
> + const char *phy_mode;
> +
> + if (!fwnode_property_read_string(fwnode, "phy-mode",
> + &phy_mode)) {
> + if (!strcmp(phy_mode, "sgmii"))
> + plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
> + if (!strcmp(phy_mode, "1000base-x"))
> + plat->phy_interface = PHY_INTERFACE_MODE_1000BASEX;
> + }

fwnode_get_phy_mode() and then validate the value afterwards.

Andrew