]> www.infradead.org Git - users/hch/configfs.git/commit
net: pcs: xpcs: Split up xpcs_create() body to sub-functions
authorSerge Semin <fancer.lancer@gmail.com>
Mon, 1 Jul 2024 18:28:33 +0000 (21:28 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jul 2024 08:35:49 +0000 (09:35 +0100)
commit03b3be07c69a5fd71e4c01a35b511c13d2adb3c5
tree2bc3444a02714f38c1ed8c68bde6acd6d46b2475
parentf37bee9508885ce5edd4875c744e1af28cfac76c
net: pcs: xpcs: Split up xpcs_create() body to sub-functions

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@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pcs/pcs-xpcs.c