diff mbox

[36/37] drm/zte: Drop drm_vblank_cleanup

Message ID 20170524145212.27837-37-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter May 24, 2017, 2:52 p.m. UTC
It again looks all cargo-culted for no good reasons.

Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/zte/zx_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Shawn Guo May 25, 2017, 3:01 a.m. UTC | #1
On Wed, May 24, 2017 at 04:52:11PM +0200, Daniel Vetter wrote:
> It again looks all cargo-culted for no good reasons.

drm_vblank_cleanup() is called to release the resources allocated by
drm_vblank_init().  I think that's the reason, no?

Shawn

> 
> Cc: Shawn Guo <shawnguo@kernel.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/zte/zx_drm_drv.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
> index 490aafc99610..696836303229 100644
> --- a/drivers/gpu/drm/zte/zx_drm_drv.c
> +++ b/drivers/gpu/drm/zte/zx_drm_drv.c
> @@ -149,7 +149,6 @@ static int zx_drm_bind(struct device *dev)
>  out_poll_fini:
>  	drm_kms_helper_poll_fini(drm);
>  	drm_mode_config_cleanup(drm);
> -	drm_vblank_cleanup(drm);
>  out_unbind:
>  	component_unbind_all(dev, drm);
>  out_unregister:
> @@ -171,7 +170,6 @@ static void zx_drm_unbind(struct device *dev)
>  	}
>  	drm_kms_helper_poll_fini(drm);
>  	drm_mode_config_cleanup(drm);
> -	drm_vblank_cleanup(drm);
>  	component_unbind_all(dev, drm);
>  	dev_set_drvdata(dev, NULL);
>  	drm->dev_private = NULL;
> -- 
> 2.11.0
>
Daniel Vetter May 26, 2017, 6:57 a.m. UTC | #2
On Thu, May 25, 2017 at 5:01 AM, Shawn Guo <shawnguo@kernel.org> wrote:
> On Wed, May 24, 2017 at 04:52:11PM +0200, Daniel Vetter wrote:
>> It again looks all cargo-culted for no good reasons.
>
> drm_vblank_cleanup() is called to release the resources allocated by
> drm_vblank_init().  I think that's the reason, no?

Pls read the code and the last patch in this series. The drm core
already calls drm_vblank_cleanup for you, the only reason it was
exported was to handle certain usersmodesetting fallback scenarios in
radeon.ko.
-Daniel
Shawn Guo May 26, 2017, 11:04 a.m. UTC | #3
On Fri, May 26, 2017 at 08:57:32AM +0200, Daniel Vetter wrote:
> On Thu, May 25, 2017 at 5:01 AM, Shawn Guo <shawnguo@kernel.org> wrote:
> > On Wed, May 24, 2017 at 04:52:11PM +0200, Daniel Vetter wrote:
> >> It again looks all cargo-culted for no good reasons.
> >
> > drm_vblank_cleanup() is called to release the resources allocated by
> > drm_vblank_init().  I think that's the reason, no?
> 
> Pls read the code and the last patch in this series. The drm core
> already calls drm_vblank_cleanup for you, the only reason it was
> exported was to handle certain usersmodesetting fallback scenarios in
> radeon.ko.

Ah, okay.  The drm_dev_unref() in the error and unbind path will
eventually triggers drm_dev_fini() where drm_vblank_cleanup() will get
called.

Thanks for the hint.  FWIW,

Acked-by: Shawn Guo <shawnguo@kernel.org>
diff mbox

Patch

diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
index 490aafc99610..696836303229 100644
--- a/drivers/gpu/drm/zte/zx_drm_drv.c
+++ b/drivers/gpu/drm/zte/zx_drm_drv.c
@@ -149,7 +149,6 @@  static int zx_drm_bind(struct device *dev)
 out_poll_fini:
 	drm_kms_helper_poll_fini(drm);
 	drm_mode_config_cleanup(drm);
-	drm_vblank_cleanup(drm);
 out_unbind:
 	component_unbind_all(dev, drm);
 out_unregister:
@@ -171,7 +170,6 @@  static void zx_drm_unbind(struct device *dev)
 	}
 	drm_kms_helper_poll_fini(drm);
 	drm_mode_config_cleanup(drm);
-	drm_vblank_cleanup(drm);
 	component_unbind_all(dev, drm);
 	dev_set_drvdata(dev, NULL);
 	drm->dev_private = NULL;