> --- a/Documentation/devicetree/bindings/net/socionext-netsec.txt
> +++ b/Documentation/devicetree/bindings/net/socionext-netsec.txt
> @@ -30,7 +30,9 @@ Optional properties: (See ethernet.txt file in the same 
> directory)
>  - max-frame-size: See ethernet.txt in the same directory.
>  
>  The MAC address will be determined using the optional properties
> -defined in ethernet.txt.
> +defined in ethernet.txt. The 'phy-mode' property is required, but may
> +be set to the empty string if the PHY configuration is programmed by
> +the firmware or set by hardware straps, and needs to be preserved.

In general, phy-mode is not mandatory. of_get_phy_mode() does the
right thing if it is not found, it sets &priv->phy_interface to
PHY_INTERFACE_MODE_NA, but returns -ENODEV. Also, it does not break
backwards compatibility to convert a mandatory property to
optional. So you could just do

        of_get_phy_mode(pdev->dev.of_node, &priv->phy_interface);

skip all the error checking, and document it as optional.

     Andrew

Reply via email to