[PATCH 4.19 026/116] net: phy: mdio-mux-bcm-iproc: check clk_prepare_enable() return value

From: Greg Kroah-Hartman
Date: Wed Apr 01 2020 - 12:23:59 EST


From: Rayagonda Kokatanur <rayagonda.kokatanur@xxxxxxxxxxxx>

[ Upstream commit 872307abbd0d9afd72171929806c2fa33dc34179 ]

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@xxxxxxxxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/net/phy/mdio-mux-bcm-iproc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/net/phy/mdio-mux-bcm-iproc.c
+++ b/drivers/net/phy/mdio-mux-bcm-iproc.c
@@ -301,8 +301,13 @@ static int mdio_mux_iproc_resume(struct
{
struct platform_device *pdev = to_platform_device(dev);
struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev);
+ 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;