aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-12-05 11:54:50 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-01-22 12:14:49 +1000
commit3532c37017f4666b74acf85b887bc11359b4765c (patch)
treeaf731de96d29ef75334e8f85f1651e9381faeb7d /drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
parentdrm/nouveau/core: fix subdev/engine/device lookup to not require engine pointer (diff)
downloadlinux-dev-3532c37017f4666b74acf85b887bc11359b4765c.tar.xz
linux-dev-3532c37017f4666b74acf85b887bc11359b4765c.zip
drm/nouveau/instmem: instobjs may not have an engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/subdev/instmem/base.c')
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/instmem/base.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
index 14706d9842ca..b2dac4a088a1 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
@@ -31,7 +31,7 @@
void
_nouveau_instobj_dtor(struct nouveau_object *object)
{
- struct nouveau_instmem *imem = (void *)object->engine;
+ struct nouveau_instmem *imem = nouveau_instmem(object);
struct nouveau_instobj *iobj = (void *)object;
mutex_lock(&nv_subdev(imem)->mutex);
@@ -47,7 +47,7 @@ nouveau_instobj_create_(struct nouveau_object *parent,
struct nouveau_oclass *oclass,
int length, void **pobject)
{
- struct nouveau_instmem *imem = (void *)engine;
+ struct nouveau_instmem *imem = nouveau_instmem(parent);
struct nouveau_instobj *iobj;
int ret;
@@ -72,10 +72,9 @@ nouveau_instmem_alloc(struct nouveau_instmem *imem,
struct nouveau_object *parent, u32 size, u32 align,
struct nouveau_object **pobject)
{
- struct nouveau_object *engine = nv_object(imem);
- struct nouveau_instmem_impl *impl = (void *)engine->oclass;
+ struct nouveau_instmem_impl *impl = (void *)imem->base.object.oclass;
struct nouveau_instobj_args args = { .size = size, .align = align };
- return nouveau_object_ctor(parent, engine, impl->instobj, &args,
+ return nouveau_object_ctor(parent, parent->engine, impl->instobj, &args,
sizeof(args), pobject);
}