summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-plat.c
diff options
context:
space:
mode:
authorBiju Das <biju.das.jz@bp.renesas.com>2023-01-21 17:58:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-25 17:48:16 +0300
commit8c6e8b09617915e8af3ab7dbfecd8f0a9c7cf94f (patch)
treebcd1b328da8759fe302c5323d6a115c383c97ac3 /drivers/usb/host/xhci-plat.c
parent3827fa1ef38f52d9de7ec6e52b4f724dd7b60bb2 (diff)
downloadlinux-8c6e8b09617915e8af3ab7dbfecd8f0a9c7cf94f.tar.xz
usb: host: xhci-plat: Improve clock handling in probe()
It is always better to acquire all the clock resources first and then do the clock operations. This patch acquires all the optional clocks first and then calls corresponding prepare_enable(). There is no functional change. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230121145853.4792-8-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-plat.c')
-rw-r--r--drivers/usb/host/xhci-plat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 5fb55bf19493..11b3a0d6722d 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -257,16 +257,16 @@ static int xhci_plat_probe(struct platform_device *pdev)
goto put_hcd;
}
- ret = clk_prepare_enable(xhci->reg_clk);
- if (ret)
- goto put_hcd;
-
xhci->clk = devm_clk_get_optional(&pdev->dev, NULL);
if (IS_ERR(xhci->clk)) {
ret = PTR_ERR(xhci->clk);
- goto disable_reg_clk;
+ goto put_hcd;
}
+ ret = clk_prepare_enable(xhci->reg_clk);
+ if (ret)
+ goto put_hcd;
+
ret = clk_prepare_enable(xhci->clk);
if (ret)
goto disable_reg_clk;