arm: mali-dp: Extract mode_config cleanup into malidp_fini
Split out malidp_fini as the opposite of malidp_init. This helps keep the cleanup paths neat and easier to manage. Signed-off-by: Brian Starkey <brian.starkey@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
This commit is contained in:
parent
a46a096a40
commit
de9c4810ab
|
@ -156,6 +156,12 @@ static int malidp_init(struct drm_device *drm)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void malidp_fini(struct drm_device *drm)
|
||||||
|
{
|
||||||
|
malidp_de_planes_destroy(drm);
|
||||||
|
drm_mode_config_cleanup(drm);
|
||||||
|
}
|
||||||
|
|
||||||
static int malidp_irq_init(struct platform_device *pdev)
|
static int malidp_irq_init(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int irq_de, irq_se, ret = 0;
|
int irq_de, irq_se, ret = 0;
|
||||||
|
@ -414,8 +420,7 @@ static int malidp_bind(struct device *dev)
|
||||||
port_fail:
|
port_fail:
|
||||||
drm_dev_unregister(drm);
|
drm_dev_unregister(drm);
|
||||||
register_fail:
|
register_fail:
|
||||||
malidp_de_planes_destroy(drm);
|
malidp_fini(drm);
|
||||||
drm_mode_config_cleanup(drm);
|
|
||||||
init_fail:
|
init_fail:
|
||||||
drm->dev_private = NULL;
|
drm->dev_private = NULL;
|
||||||
dev_set_drvdata(dev, NULL);
|
dev_set_drvdata(dev, NULL);
|
||||||
|
@ -448,8 +453,7 @@ static void malidp_unbind(struct device *dev)
|
||||||
of_node_put(malidp->crtc.port);
|
of_node_put(malidp->crtc.port);
|
||||||
malidp->crtc.port = NULL;
|
malidp->crtc.port = NULL;
|
||||||
drm_dev_unregister(drm);
|
drm_dev_unregister(drm);
|
||||||
malidp_de_planes_destroy(drm);
|
malidp_fini(drm);
|
||||||
drm_mode_config_cleanup(drm);
|
|
||||||
drm->dev_private = NULL;
|
drm->dev_private = NULL;
|
||||||
dev_set_drvdata(dev, NULL);
|
dev_set_drvdata(dev, NULL);
|
||||||
clk_disable_unprepare(hwdev->mclk);
|
clk_disable_unprepare(hwdev->mclk);
|
||||||
|
|
Loading…
Reference in New Issue