]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - drivers/gpu/drm/ttm/ttm_device.c
Merge drm-misc-next-fixes-2024-01-19 into drm-misc-fixes
[thirdparty/linux.git] / drivers / gpu / drm / ttm / ttm_device.c
index e787c155a56922e6a84c7c0d785e6af98e4e2256..76027960054f1140e768ae21b30e5a3015437d02 100644 (file)
@@ -201,7 +201,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;
@@ -221,7 +221,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);