[1/4] drm/omap: reorganize locking in mgr_fld_write

Message ID 1518423562-1191-1-git-send-email-tomi.valkeinen@ti.com
State New
Headers show
Series
  • [1/4] drm/omap: reorganize locking in mgr_fld_write
Related show

Commit Message

Tomi Valkeinen Feb. 12, 2018, 8:19 a.m.
Fix sparse warning:

drivers/gpu/drm/omapdrm/dss/dispc.c:387:9: warning: context imbalance in 'mgr_fld_write' - different lock contexts for basic block

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 86d18f2d48ba..679931e108f9 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -384,13 +384,13 @@  static void mgr_fld_write(enum omap_channel channel,
 	const bool need_lock = rfld.reg == DISPC_CONTROL || rfld.reg == DISPC_CONFIG;
 	unsigned long flags;
 
-	if (need_lock)
+	if (need_lock) {
 		spin_lock_irqsave(&dispc.control_lock, flags);
-
-	REG_FLD_MOD(rfld.reg, val, rfld.high, rfld.low);
-
-	if (need_lock)
+		REG_FLD_MOD(rfld.reg, val, rfld.high, rfld.low);
 		spin_unlock_irqrestore(&dispc.control_lock, flags);
+	} else {
+		REG_FLD_MOD(rfld.reg, val, rfld.high, rfld.low);
+	}
 }
 
 static int dispc_get_num_ovls(void)