diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-08-11 01:52:44 (GMT) |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-08-14 21:58:38 (GMT) |
commit | e7d96929a7cd93e146af0d1fd251fa1ec2e3ebf8 (patch) | |
tree | 4af6f75c5b557c4342227712e8d4d4e0b951d55a /drivers/gpu/drm | |
parent | e715396ae3d55c4369ac3438e589a440780bc5ba (diff) | |
download | linux-e7d96929a7cd93e146af0d1fd251fa1ec2e3ebf8.tar.xz |
drm/nouveau/bar: behave better if ioremap failed
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-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 73b1ed2..8bcbdf3 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, struct nouveau_mem *mem, struct nouveau_object **pobject) { struct nouveau_object *engine = nv_object(bar); - return nouveau_object_ctor(parent, engine, &nouveau_barobj_oclass, - mem, 0, pobject); + int ret = -ENOMEM; + if (bar->iomem) { + ret = nouveau_object_ctor(parent, engine, + &nouveau_barobj_oclass, + mem, 0, pobject); + } + return ret; } int @@ -118,9 +123,12 @@ nouveau_bar_create_(struct nouveau_object *parent, if (ret) return ret; - if (nv_device_resource_len(device, 3) != 0) + if (nv_device_resource_len(device, 3) != 0) { bar->iomem = ioremap(nv_device_resource_start(device, 3), nv_device_resource_len(device, 3)); + if (!bar->iomem) + nv_warn(bar, "PRAMIN ioremap failed\n"); + } return 0; } |