[PATCH net-next 1/2] net: axienet: use device_property and fwnode APIs for probe-time config

Andrew Lunn andrew at lunn.ch
Sun Sep 27 10:55:27 PDT 2026


> -	lp->switch_x_sgmii = of_property_read_bool(pdev->dev.of_node,
> -						   "xlnx,switch-x-sgmii");
> +	lp->switch_x_sgmii = device_property_read_bool(&pdev->dev,
> +						       "xlnx,switch-x-sgmii");

What version of the core is being used:

6c8f06bb2e5147b2c25bdd726365df8416c13987
Author: Robert Hancock <robert.hancock at calian.com>
Date:   Fri Feb 12 18:23:56 2021 -0600

    net: axienet: Support dynamic switching between 1000BaseX and SGMII
    
    Newer versions of the Xilinx AXI Ethernet core (specifically version 7.2 or
    later) allow the core to be configured with a PHY interface mode of "Both",
    allowing either 1000BaseX or SGMII modes to be selected at runtime. Add
    support for this in the driver to allow better support for applications
    which can use both fiber and copper SFP modules.

If this property is not needed, please leave it as OF only.

>  
>  	/* Start with the proprietary, and broken phy_type */
> -	ret = of_property_read_u32(pdev->dev.of_node, "xlnx,phy-type", &value);
> +	ret = device_property_read_u32(&pdev->dev, "xlnx,phy-type", &value);

  xlnx,phy-type:
    description:
      Do not use, but still accepted in preference to phy-mode.
    deprecated: true

This property is deprecated. So it should remain an OF property and
not get expanded in scope.

	Andrew



More information about the linux-arm-kernel mailing list