net: bcmgenet: Pass "main" clock down to the MDIO driver
authorFlorian Fainelli <florian.fainelli@broadcom.com>
Mon, 19 Feb 2024 20:40:52 +0000 (12:40 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Feb 2024 12:46:17 +0000 (12:46 +0000)
GENET has historically had to create a MDIO platform device for its
controller and pass some auxiliary data to it, like a MDIO completion
callback. Now we also pass the "main" clock to allow for the MDIO bus
controller to manage that clock adequately around I/O accesses.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmmii.c

index cbbe004621bc6849ed08415128b7bd76eb371517..7a21950da77c80436b921b98e42f8f18984edf8c 100644 (file)
@@ -476,6 +476,10 @@ static int bcmgenet_mii_register(struct bcmgenet_priv *priv)
        ppd.wait_func = bcmgenet_mii_wait;
        ppd.wait_func_data = priv;
        ppd.bus_name = "bcmgenet MII bus";
+       /* Pass a reference to our "main" clock which is used for MDIO
+        * transfers
+        */
+       ppd.clk = priv->clk;
 
        /* Unimac MDIO bus controller starts at UniMAC offset + MDIO_CMD
         * and is 2 * 32-bits word long, 8 bytes total.