summaryrefslogtreecommitdiff
path: root/nvkm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-12-05 12:08:20 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-01-10 23:57:07 +1000
commit88314d3280fa785099535fa67962e48c73a07620 (patch)
tree73442ac5f341479274e54e9fa7589cfa2bdeb642 /nvkm
parent5e3bd4ae3714a3b615f4b323178ee2e022ce5e2b (diff)
downloadnouveau-88314d3280fa785099535fa67962e48c73a07620.tar.gz
bar: barobjs may not have an engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nvkm')
-rw-r--r--nvkm/subdev/bar/base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/nvkm/subdev/bar/base.c b/nvkm/subdev/bar/base.c
index b1adc69ef..24fb89fd5 100644
--- a/nvkm/subdev/bar/base.c
+++ b/nvkm/subdev/bar/base.c
@@ -42,7 +42,7 @@ nouveau_barobj_ctor(struct nouveau_object *parent,
struct nouveau_object **pobject)
{
struct nouveau_device *device = nv_device(parent);
- struct nouveau_bar *bar = (void *)engine;
+ struct nouveau_bar *bar = nouveau_bar(device);
struct nouveau_mem *mem = data;
struct nouveau_barobj *barobj;
int ret;
@@ -69,7 +69,7 @@ nouveau_barobj_ctor(struct nouveau_object *parent,
static void
nouveau_barobj_dtor(struct nouveau_object *object)
{
- struct nouveau_bar *bar = (void *)object->engine;
+ struct nouveau_bar *bar = nouveau_bar(object);
struct nouveau_barobj *barobj = (void *)object;
if (barobj->vma.node) {
if (barobj->iomem)
@@ -109,9 +109,9 @@ int
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);
struct nouveau_object *gpuobj;
- int ret = nouveau_object_ctor(parent, engine, &nouveau_barobj_oclass,
+ int ret = nouveau_object_ctor(parent, parent->engine,
+ &nouveau_barobj_oclass,
mem, 0, &gpuobj);
if (ret == 0)
*pobject = gpuobj;