]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net/fsl_pq_mdio: streamline probing of MDIO nodes
authorTimur Tabi <timur@freescale.com>
Wed, 29 Aug 2012 08:08:01 +0000 (08:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Aug 2012 17:29:32 +0000 (13:29 -0400)
commitafae5ad78b342f401c28b0bb1adb3cd494cb125a
tree29413d2fac8a98f65facc8988b013fb5e38826a7
parent5078ac79588600208ec21d1c7781e5cd8a7ab830
net/fsl_pq_mdio: streamline probing of MDIO nodes

Make the device tree probe function more data-driven, so that it no longer
searches the 'compatible' property more than once.  The of_device_id[] array
allows for per-entry private data, so we use that to store details about each
type of node that the driver supports.  This removes the need to check the
'compatible' property inside the probe function.

The driver supports four types on MDIO devices:

1) Gianfar MDIO nodes that only map the MII registers
2) Gianfar MDIO nodes that map the full MDIO register set
3) eTSEC2 MDIO nodes (which map the full MDIO register set)
4) QE MDIO nodes (which map only the MII registers)

Gianfar, eTSEC2, and QE have different mappings for the TBIPA register, which
is needed to initialize the TBI PHY.  In addition, the QE needs a special
hack because of the way the device tree is ordered.

All of this information is encapsulated in the fsl_pq_mdio_data structure,
so when an MDIO node is probed, per-device data and functions are used
to determine how to initialize the device.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fsl_pq_mdio.c