usb: chipidea: msm: Use device-managed registration API
Use devm_reset_controller_register to get rid of manual unregistration. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
This commit is contained in:
parent
05559f10ed
commit
ecd55e367f
|
@ -216,13 +216,13 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev)
|
||||||
ci->rcdev.ops = &ci_hdrc_msm_reset_ops;
|
ci->rcdev.ops = &ci_hdrc_msm_reset_ops;
|
||||||
ci->rcdev.of_node = pdev->dev.of_node;
|
ci->rcdev.of_node = pdev->dev.of_node;
|
||||||
ci->rcdev.nr_resets = 2;
|
ci->rcdev.nr_resets = 2;
|
||||||
ret = reset_controller_register(&ci->rcdev);
|
ret = devm_reset_controller_register(&pdev->dev, &ci->rcdev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = clk_prepare_enable(ci->fs_clk);
|
ret = clk_prepare_enable(ci->fs_clk);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_fs;
|
return ret;
|
||||||
|
|
||||||
reset_control_assert(reset);
|
reset_control_assert(reset);
|
||||||
usleep_range(10000, 12000);
|
usleep_range(10000, 12000);
|
||||||
|
@ -232,7 +232,7 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
ret = clk_prepare_enable(ci->core_clk);
|
ret = clk_prepare_enable(ci->core_clk);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_fs;
|
return ret;
|
||||||
|
|
||||||
ret = clk_prepare_enable(ci->iface_clk);
|
ret = clk_prepare_enable(ci->iface_clk);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -271,8 +271,6 @@ err_mux:
|
||||||
clk_disable_unprepare(ci->iface_clk);
|
clk_disable_unprepare(ci->iface_clk);
|
||||||
err_iface:
|
err_iface:
|
||||||
clk_disable_unprepare(ci->core_clk);
|
clk_disable_unprepare(ci->core_clk);
|
||||||
err_fs:
|
|
||||||
reset_controller_unregister(&ci->rcdev);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,7 +282,6 @@ static int ci_hdrc_msm_remove(struct platform_device *pdev)
|
||||||
ci_hdrc_remove_device(ci->ci);
|
ci_hdrc_remove_device(ci->ci);
|
||||||
clk_disable_unprepare(ci->iface_clk);
|
clk_disable_unprepare(ci->iface_clk);
|
||||||
clk_disable_unprepare(ci->core_clk);
|
clk_disable_unprepare(ci->core_clk);
|
||||||
reset_controller_unregister(&ci->rcdev);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue