Skip to content

Commit ece7af5

Browse files
ArvindYadavCsFelipe Balbi
authored andcommitted
usb: dwc3: exynos: Handle return value of clk_prepare_enable
clk_prepare_enable() can fail here and we must check its return value. Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 0e1b89e commit ece7af5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

drivers/usb/dwc3/dwc3-exynos.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,16 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
125125
dev_err(dev, "couldn't get clock\n");
126126
return -EINVAL;
127127
}
128-
clk_prepare_enable(exynos->clk);
128+
ret = clk_prepare_enable(exynos->clk);
129+
if (ret)
130+
return ret;
129131

130132
exynos->susp_clk = devm_clk_get(dev, "usbdrd30_susp_clk");
131133
if (IS_ERR(exynos->susp_clk))
132134
exynos->susp_clk = NULL;
133-
clk_prepare_enable(exynos->susp_clk);
135+
ret = clk_prepare_enable(exynos->susp_clk);
136+
if (ret)
137+
goto susp_clk_err;
134138

135139
if (of_device_is_compatible(node, "samsung,exynos7-dwusb3")) {
136140
exynos->axius_clk = devm_clk_get(dev, "usbdrd30_axius_clk");
@@ -139,7 +143,9 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
139143
ret = -ENODEV;
140144
goto axius_clk_err;
141145
}
142-
clk_prepare_enable(exynos->axius_clk);
146+
ret = clk_prepare_enable(exynos->axius_clk);
147+
if (ret)
148+
goto axius_clk_err;
143149
} else {
144150
exynos->axius_clk = NULL;
145151
}
@@ -197,6 +203,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
197203
clk_disable_unprepare(exynos->axius_clk);
198204
axius_clk_err:
199205
clk_disable_unprepare(exynos->susp_clk);
206+
susp_clk_err:
200207
clk_disable_unprepare(exynos->clk);
201208
return ret;
202209
}

0 commit comments

Comments
 (0)