From: Ben Skeggs Date: Fri, 5 Dec 2014 02:08:20 +0000 (+1000) Subject: drm/nouveau/bar: barobjs may not have an engine X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c272d86e70db2b59a458c4c4e0460bf41ae42948;p=openwrt%2Fstaging%2Fblogic.git drm/nouveau/bar: barobjs may not have an engine Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/core/subdev/bar/base.c b/drivers/gpu/drm/nouveau/core/subdev/bar/base.c index b1adc69efd88..24fb89fd580f 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bar/base.c +++ b/drivers/gpu/drm/nouveau/core/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;