Call __drm_atomic_helper_plane_destroy_state() in the plane reset handler instead of open-coding it. This will avoid changes to the driver if plane state later gets more fields that need to be reset.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com> --- drivers/gpu/drm/omapdrm/omap_plane.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index cfa8276c4deb..ddcc74a6059d 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -165,8 +165,7 @@ static void omap_plane_reset(struct drm_plane *plane) struct omap_plane *omap_plane = to_omap_plane(plane); struct omap_plane_state *omap_state; - if (plane->state && plane->state->fb) - drm_framebuffer_unreference(plane->state->fb); + __drm_atomic_helper_plane_destroy_state(plane, plane->state); kfree(plane->state); plane->state = NULL; -- Regards, Laurent Pinchart