net: phy: mdio-mux-bcm-iproc: check clk_prepare_enable() return value
authorRayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Tue, 17 Mar 2020 04:54:35 +0000 (10:24 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Mar 2020 04:20:38 +0000 (21:20 -0700)
Check clk_prepare_enable() return value.

Fixes: 2c7230446bc9 ("net: phy: Add pm support to Broadcom iProc mdio mux driver")
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio-mux-bcm-iproc.c

index 88d409e..aad6809 100644 (file)
@@ -288,8 +288,13 @@ static int mdio_mux_iproc_suspend(struct device *dev)
 static int mdio_mux_iproc_resume(struct device *dev)
 {
        struct iproc_mdiomux_desc *md = dev_get_drvdata(dev);
+       int rc;
 
-       clk_prepare_enable(md->core_clk);
+       rc = clk_prepare_enable(md->core_clk);
+       if (rc) {
+               dev_err(md->dev, "failed to enable core clk\n");
+               return rc;
+       }
        mdio_mux_iproc_config(md);
 
        return 0;