ctx->state = MFCINST_RES_CHANGE_INIT;
                s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);
                wake_up_ctx(ctx, reason, err);
-               if (test_and_clear_bit(0, &dev->hw_lock) == 0)
-                       BUG();
+               WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
                s5p_mfc_clock_off();
                s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);
                return;
                clear_work_bit(ctx);
        s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);
        wake_up_ctx(ctx, reason, err);
-       if (test_and_clear_bit(0, &dev->hw_lock) == 0)
-               BUG();
+       WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
        s5p_mfc_clock_off();
        /* if suspending, wake up device and do not try_run again*/
        if (test_bit(0, &dev->enter_suspend))
                        break;
                }
        }
-       if (test_and_clear_bit(0, &dev->hw_lock) == 0)
-               BUG();
+       WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
        s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);
        s5p_mfc_clock_off();
        wake_up_dev(dev, reason, err);
        }
        s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);
        clear_work_bit(ctx);
-       if (test_and_clear_bit(0, &dev->hw_lock) == 0)
-               BUG();
+       WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
        s5p_mfc_clock_off();
        s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);
        wake_up_ctx(ctx, reason, err);
                } else {
                        ctx->dpb_flush_flag = 0;
                }
-               if (test_and_clear_bit(0, &dev->hw_lock) == 0)
-                       BUG();
+               WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
 
                s5p_mfc_clock_off();
 
                wake_up(&ctx->queue);
                s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);
        } else {
-               if (test_and_clear_bit(0, &dev->hw_lock) == 0)
-                       BUG();
+               WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
 
                s5p_mfc_clock_off();
 
                                mfc_err("post_frame_start() failed\n");
                        s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);
                        wake_up_ctx(ctx, reason, err);
-                       if (test_and_clear_bit(0, &dev->hw_lock) == 0)
-                               BUG();
+                       WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
                        s5p_mfc_clock_off();
                        s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);
                } else {