Commit a363d505 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Greg Kroah-Hartman

usb: host: fotg210: add missed clk_put calls

The driver forgets to call clk_put when probe fails and remove.
Add the calls to fix it.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20191102062245.4014-1-hslester96@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4ff0eccb
...@@ -5646,8 +5646,10 @@ static int fotg210_hcd_probe(struct platform_device *pdev) ...@@ -5646,8 +5646,10 @@ static int fotg210_hcd_probe(struct platform_device *pdev)
return retval; return retval;
failed_dis_clk: failed_dis_clk:
if (!IS_ERR(fotg210->pclk)) if (!IS_ERR(fotg210->pclk)) {
clk_disable_unprepare(fotg210->pclk); clk_disable_unprepare(fotg210->pclk);
clk_put(fotg210->pclk);
}
failed_put_hcd: failed_put_hcd:
usb_put_hcd(hcd); usb_put_hcd(hcd);
fail_create_hcd: fail_create_hcd:
...@@ -5665,8 +5667,10 @@ static int fotg210_hcd_remove(struct platform_device *pdev) ...@@ -5665,8 +5667,10 @@ static int fotg210_hcd_remove(struct platform_device *pdev)
struct usb_hcd *hcd = platform_get_drvdata(pdev); struct usb_hcd *hcd = platform_get_drvdata(pdev);
struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd); struct fotg210_hcd *fotg210 = hcd_to_fotg210(hcd);
if (!IS_ERR(fotg210->pclk)) if (!IS_ERR(fotg210->pclk)) {
clk_disable_unprepare(fotg210->pclk); clk_disable_unprepare(fotg210->pclk);
clk_put(fotg210->pclk);
}
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
usb_put_hcd(hcd); usb_put_hcd(hcd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment