Skip to content

Commit

Permalink
usb: cdns3: imx: improve driver .remove API
Browse files Browse the repository at this point in the history
Keep the runtime active during the remove operation, and disable
related clocks.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
  • Loading branch information
Peter Chen committed Dec 29, 2020
1 parent 2ef02b8 commit d135711
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/usb/cdns3/cdns3-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,13 @@ static int cdns_imx_probe(struct platform_device *pdev)
static int cdns_imx_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct cdns_imx *data = dev_get_drvdata(dev);

pm_runtime_get_sync(dev);
of_platform_depopulate(dev);
clk_bulk_disable_unprepare(data->num_clks, data->clks);
pm_runtime_disable(dev);
pm_runtime_put_noidle(dev);
platform_set_drvdata(pdev, NULL);

return 0;
Expand Down

0 comments on commit d135711

Please sign in to comment.