Merge branch 'x86-atomic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / ttm / ttm_bo.c
index 89c38c49066f2d87a69ecf58d528f2cf209a26af..0e3754a3a303c18391538180b702a2b0e4c66399 100644 (file)
@@ -1425,8 +1425,8 @@ int ttm_bo_global_init(struct ttm_global_reference *ref)
 
        atomic_set(&glob->bo_count, 0);
 
-       kobject_init(&glob->kobj, &ttm_bo_glob_kobj_type);
-       ret = kobject_add(&glob->kobj, ttm_get_kobj(), "buffer_objects");
+       ret = kobject_init_and_add(
+               &glob->kobj, &ttm_bo_glob_kobj_type, ttm_get_kobj(), "buffer_objects");
        if (unlikely(ret != 0))
                kobject_put(&glob->kobj);
        return ret;
@@ -1716,40 +1716,12 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
 }
 EXPORT_SYMBOL(ttm_bo_wait);
 
-void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo)
-{
-       atomic_set(&bo->reserved, 0);
-       wake_up_all(&bo->event_queue);
-}
-
-int ttm_bo_block_reservation(struct ttm_buffer_object *bo, bool interruptible,
-                            bool no_wait)
-{
-       int ret;
-
-       while (unlikely(atomic_cmpxchg(&bo->reserved, 0, 1) != 0)) {
-               if (no_wait)
-                       return -EBUSY;
-               else if (interruptible) {
-                       ret = wait_event_interruptible
-                           (bo->event_queue, atomic_read(&bo->reserved) == 0);
-                       if (unlikely(ret != 0))
-                               return ret;
-               } else {
-                       wait_event(bo->event_queue,
-                                  atomic_read(&bo->reserved) == 0);
-               }
-       }
-       return 0;
-}
-
 int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait)
 {
        int ret = 0;
 
        /*
-        * Using ttm_bo_reserve instead of ttm_bo_block_reservation
-        * makes sure the lru lists are updated.
+        * Using ttm_bo_reserve makes sure the lru lists are updated.
         */
 
        ret = ttm_bo_reserve(bo, true, no_wait, false, 0);