[PATCH 04/12] net: rswitch: Use bulk clock operations
    Marek Vasut 
    marek.vasut+renesas at mailbox.org
       
    Mon Oct 27 17:45:34 CET 2025
    
    
  
The new version of RSwitch3 in Renesas R-Car Gen5 uses multiple
clock to supply the IP. Convert the driver to bulk clock API to
cater for both single clock of R-Car S4 and multiple clock of
R-Car Gen5. No functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
Cc: Jerome Forissier <jerome.forissier at linaro.org>
Cc: Joe Hershberger <joe.hershberger at ni.com>
Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
Cc: Paul Barker <paul.barker.ct at bp.renesas.com>
Cc: Ramon Fried <rfried.dev at gmail.com>
Cc: Simon Glass <sjg at chromium.org>
Cc: Tom Rini <trini at konsulko.com>
Cc: u-boot at lists.denx.de
---
 drivers/net/rswitch.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/rswitch.c b/drivers/net/rswitch.c
index f787aa4180d..3048db365db 100644
--- a/drivers/net/rswitch.c
+++ b/drivers/net/rswitch.c
@@ -272,7 +272,7 @@ struct rswitch_port_priv {
 
 struct rswitch_priv {
 	void __iomem		*addr;
-	struct clk		*rsw_clk;
+	struct clk_bulk		rsw_clk;
 };
 
 static inline void rswitch_flush_dcache(u32 addr, u32 len)
@@ -1101,13 +1101,11 @@ static int rswitch_probe(struct udevice *dev)
 	if (!priv->addr)
 		return -EINVAL;
 
-	priv->rsw_clk = devm_clk_get(dev, NULL);
-	if (IS_ERR(priv->rsw_clk)) {
-		ret = PTR_ERR(priv->rsw_clk);
+	ret = clk_get_bulk(dev, &priv->rsw_clk);
+	if (ret < 0)
 		goto err_map;
-	}
 
-	ret = clk_prepare_enable(priv->rsw_clk);
+	ret = clk_enable_bulk(&priv->rsw_clk);
 	if (ret)
 		goto err_map;
 
@@ -1122,7 +1120,7 @@ static int rswitch_remove(struct udevice *dev)
 {
 	struct rswitch_priv *priv = dev_get_plat(dev);
 
-	clk_disable_unprepare(priv->rsw_clk);
+	clk_disable_bulk(&priv->rsw_clk);
 	unmap_physmem(priv->addr, MAP_NOCACHE);
 
 	return 0;
-- 
2.51.0
    
    
More information about the U-Boot
mailing list