diff options
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/bar/base.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bar/base.c b/drivers/gpu/drm/nouveau/core/subdev/bar/base.c index 73b1ed20c8d5..8bcbdf39cfb2 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bar/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bar/base.c | |||
| @@ -99,8 +99,13 @@ nouveau_bar_alloc(struct nouveau_bar *bar, struct nouveau_object *parent, | |||
| 99 | struct nouveau_mem *mem, struct nouveau_object **pobject) | 99 | struct nouveau_mem *mem, struct nouveau_object **pobject) |
| 100 | { | 100 | { |
| 101 | struct nouveau_object *engine = nv_object(bar); | 101 | struct nouveau_object *engine = nv_object(bar); |
| 102 | return nouveau_object_ctor(parent, engine, &nouveau_barobj_oclass, | 102 | int ret = -ENOMEM; |
| 103 | mem, 0, pobject); | 103 | if (bar->iomem) { |
| 104 | ret = nouveau_object_ctor(parent, engine, | ||
| 105 | &nouveau_barobj_oclass, | ||
| 106 | mem, 0, pobject); | ||
| 107 | } | ||
| 108 | return ret; | ||
| 104 | } | 109 | } |
| 105 | 110 | ||
| 106 | int | 111 | int |
| @@ -118,9 +123,12 @@ nouveau_bar_create_(struct nouveau_object *parent, | |||
| 118 | if (ret) | 123 | if (ret) |
| 119 | return ret; | 124 | return ret; |
| 120 | 125 | ||
| 121 | if (nv_device_resource_len(device, 3) != 0) | 126 | if (nv_device_resource_len(device, 3) != 0) { |
| 122 | bar->iomem = ioremap(nv_device_resource_start(device, 3), | 127 | bar->iomem = ioremap(nv_device_resource_start(device, 3), |
| 123 | nv_device_resource_len(device, 3)); | 128 | nv_device_resource_len(device, 3)); |
| 129 | if (!bar->iomem) | ||
| 130 | nv_warn(bar, "PRAMIN ioremap failed\n"); | ||
| 131 | } | ||
| 124 | 132 | ||
| 125 | return 0; | 133 | return 0; |
| 126 | } | 134 | } |
