drm/ttm: fix ttm pool initialization for no-dma-device drivers
[linux-2.6-microblaze.git] / drivers / gpu / drm / ttm / ttm_device.c
index f5187b3..4130945 100644 (file)
@@ -195,7 +195,7 @@ int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *func
                    bool use_dma_alloc, bool use_dma32)
 {
        struct ttm_global *glob = &ttm_glob;
-       int ret;
+       int ret, nid;
 
        if (WARN_ON(vma_manager == NULL))
                return -EINVAL;
@@ -215,7 +215,12 @@ int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *func
 
        ttm_sys_man_init(bdev);
 
-       ttm_pool_init(&bdev->pool, dev, dev_to_node(dev), use_dma_alloc, use_dma32);
+       if (dev)
+               nid = dev_to_node(dev);
+       else
+               nid = NUMA_NO_NODE;
+
+       ttm_pool_init(&bdev->pool, dev, nid, use_dma_alloc, use_dma32);
 
        bdev->vma_manager = vma_manager;
        spin_lock_init(&bdev->lru_lock);