Commit c272d86e authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/bar: barobjs may not have an engine

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 9d18cdbb
...@@ -42,7 +42,7 @@ nouveau_barobj_ctor(struct nouveau_object *parent, ...@@ -42,7 +42,7 @@ nouveau_barobj_ctor(struct nouveau_object *parent,
struct nouveau_object **pobject) struct nouveau_object **pobject)
{ {
struct nouveau_device *device = nv_device(parent); 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_mem *mem = data;
struct nouveau_barobj *barobj; struct nouveau_barobj *barobj;
int ret; int ret;
...@@ -69,7 +69,7 @@ nouveau_barobj_ctor(struct nouveau_object *parent, ...@@ -69,7 +69,7 @@ nouveau_barobj_ctor(struct nouveau_object *parent,
static void static void
nouveau_barobj_dtor(struct nouveau_object *object) 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; struct nouveau_barobj *barobj = (void *)object;
if (barobj->vma.node) { if (barobj->vma.node) {
if (barobj->iomem) if (barobj->iomem)
...@@ -109,9 +109,9 @@ int ...@@ -109,9 +109,9 @@ int
nouveau_bar_alloc(struct nouveau_bar *bar, struct nouveau_object *parent, nouveau_bar_alloc(struct nouveau_bar *bar, struct nouveau_object *parent,
struct nouveau_mem *mem, struct nouveau_object **pobject) struct nouveau_mem *mem, struct nouveau_object **pobject)
{ {
struct nouveau_object *engine = nv_object(bar);
struct nouveau_object *gpuobj; 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); mem, 0, &gpuobj);
if (ret == 0) if (ret == 0)
*pobject = gpuobj; *pobject = gpuobj;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment