drm/armada: move the locking for armada_drm_vbl_event_remove()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 15 Jul 2015 17:11:25 +0000 (18:11 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 1 Oct 2015 13:33:28 +0000 (14:33 +0100)
Move the locking for armada_drm_vbl_event_remove() into itself, which
makes this function symmetrical with armada_drm_vbl_event_add().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/gpu/drm/armada/armada_crtc.c
drivers/gpu/drm/armada/armada_overlay.c

index 89decc5bdcd4daebafacfa5ab3e15842d754d5fb..e3e6f81593c06cd57f24f0d6acd22b76410c2f77 100644 (file)
@@ -211,10 +211,12 @@ void armada_drm_vbl_event_add(struct armada_crtc *dcrtc,
 void armada_drm_vbl_event_remove(struct armada_crtc *dcrtc,
        struct armada_vbl_event *evt)
 {
+       spin_lock_irq(&dcrtc->irq_lock);
        if (!list_empty(&evt->node)) {
                list_del_init(&evt->node);
                drm_vblank_put(dcrtc->crtc.dev, dcrtc->num);
        }
+       spin_unlock_irq(&dcrtc->irq_lock);
 }
 
 static void armada_drm_vbl_event_run(struct armada_crtc *dcrtc)
index e7e020d4372a4cab2bf7b265712a4bd2a3dadde8..6ec42eb85981536b9aa3e1816a5c05b38df11059 100644 (file)
@@ -273,9 +273,7 @@ static int armada_ovl_plane_disable(struct drm_plane *plane)
        dcrtc = drm_to_armada_crtc(dplane->base.base.crtc);
        dcrtc->plane = NULL;
 
-       spin_lock_irq(&dcrtc->irq_lock);
        armada_drm_vbl_event_remove(dcrtc, &dplane->vbl.update);
-       spin_unlock_irq(&dcrtc->irq_lock);
 
        dplane->ctrl0 = 0;