Thread (31 messages) 31 messages, 5 authors, 2018-07-31

[PATCH v2 7/7] net: phy: Add pm support to Broadcom iProc mdio mux driver

From: f.fainelli@gmail.com (Florian Fainelli)
Date: 2018-07-30 22:53:12
Also in: linux-devicetree, lkml, netdev

On 07/27/2018 02:23 PM, Arun Parameswaran wrote:
quoted hunk ↗ jump to hunk
Add support for suspend and resume to the Broadcom iProc mdio
mux driver.

Signed-off-by: Arun Parameswaran <redacted>
---
 drivers/net/phy/mdio-mux-bcm-iproc.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
diff --git a/drivers/net/phy/mdio-mux-bcm-iproc.c b/drivers/net/phy/mdio-mux-bcm-iproc.c
index 51d1003..d89dce0 100644
--- a/drivers/net/phy/mdio-mux-bcm-iproc.c
+++ b/drivers/net/phy/mdio-mux-bcm-iproc.c
@@ -290,6 +290,33 @@ static int mdio_mux_iproc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int mdio_mux_iproc_suspend(struct device *dev)
+{
+	struct iproc_mdiomux_desc *md = dev_get_drvdata(dev);
+
+	if (md->core_clk)
+		clk_disable_unprepare(md->core_clk);
Since you are assigning md->core_clk to NULL in case clk_get() returned
an error, checking for md->core_clk is not necessary since the Linux
common clock framework perform that NULL check already.
-- 
-- 
Florian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help