[PATCH net-next v3 02/10] net: pcs: xpcs: Split up xpcs_create() body to sub-functions

Andrew Lunn andrew at lunn.ch
Thu Jun 27 23:07:01 AEST 2024


On Thu, Jun 27, 2024 at 03:41:22AM +0300, Serge Semin wrote:
> As an initial preparation before adding the fwnode-based DW XPCS device
> support let's split the xpcs_create() function code up to a set of the
> small sub-functions. Thus the xpcs_create() implementation will get to
> look simpler and turn to be more coherent. Further updates will just touch
> the new sub-functions a bit: add platform-specific device info, add the
> reference clock getting and enabling.
> 
> The xpcs_create() method will now contain the next static methods calls:
> 
> xpcs_create_data() - create the DW XPCS device descriptor, pre-initialize
> it' fields and increase the mdio device refcount-er;
> 
> xpcs_init_id() - find XPCS ID instance and save it in the device
> descriptor;
> 
> xpcs_init_iface() - find MAC/PCS interface descriptor and perform
> basic initialization specific to it: soft-reset, disable polling.
> 
> The update doesn't imply any semantic change but merely makes the code
> looking simpler and more ready for adding new features support.
> 
> Note the xpcs_destroy() has been moved to being defined below the
> xpcs_create_mdiodev() function as the driver now implies having the
> protagonist-then-antagonist functions definition order.
> 
> Signed-off-by: Serge Semin <fancer.lancer at gmail.com>

Reviewed-by: Andrew Lunn <andrew at lunn.ch>

    Andrew


More information about the openbmc mailing list