drm/msm/dsi: use devm_of_clk_add_hw_provider
Use devm_of_clk_add_hw_provider() to register provided clocks. This allows dropping the remove function alltogether. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org> Tested-by: Stephen Boyd <swboyd@chromium.org> # on sc7180 lazor Link: https://lore.kernel.org/r/20210331105735.3690009-13-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
parent
613cbd1da3
commit
a7c13d4f59
@ -728,7 +728,7 @@ static int dsi_phy_driver_probe(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
|
||||
ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
|
||||
phy->provided_clocks);
|
||||
if (ret) {
|
||||
DRM_DEV_ERROR(dev, "%s: failed to register clk provider: %d\n", __func__, ret);
|
||||
@ -742,31 +742,11 @@ static int dsi_phy_driver_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
if (phy->pll) {
|
||||
of_clk_del_provider(dev->of_node);
|
||||
phy->pll = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int dsi_phy_driver_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct msm_dsi_phy *phy = platform_get_drvdata(pdev);
|
||||
|
||||
if (phy && phy->pll) {
|
||||
of_clk_del_provider(pdev->dev.of_node);
|
||||
phy->pll = NULL;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver dsi_phy_platform_driver = {
|
||||
.probe = dsi_phy_driver_probe,
|
||||
.remove = dsi_phy_driver_remove,
|
||||
.driver = {
|
||||
.name = "msm_dsi_phy",
|
||||
.of_match_table = dsi_phy_dt_match,
|
||||
|
Loading…
x
Reference in New Issue
Block a user