Commit b5795c77 authored by Ben Skeggs's avatar Ben Skeggs

drm/nv04-nv40/instmem: remove parent deref hack

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent d395f1e4
...@@ -93,7 +93,6 @@ nv04_instmem_alloc(struct nouveau_instmem *imem, struct nouveau_object *parent, ...@@ -93,7 +93,6 @@ nv04_instmem_alloc(struct nouveau_instmem *imem, struct nouveau_object *parent,
u32 size, u32 align, struct nouveau_object **pobject) u32 size, u32 align, struct nouveau_object **pobject)
{ {
struct nouveau_object *engine = nv_object(imem); struct nouveau_object *engine = nv_object(imem);
struct nv04_instmem_priv *priv = (void *)(imem);
int ret; int ret;
ret = nouveau_object_ctor(parent, engine, &nv04_instobj_oclass, ret = nouveau_object_ctor(parent, engine, &nv04_instobj_oclass,
...@@ -101,14 +100,6 @@ nv04_instmem_alloc(struct nouveau_instmem *imem, struct nouveau_object *parent, ...@@ -101,14 +100,6 @@ nv04_instmem_alloc(struct nouveau_instmem *imem, struct nouveau_object *parent,
if (ret) if (ret)
return ret; return ret;
/* INSTMEM itself creates objects to reserve (and preserve across
* suspend/resume) various fixed data locations, each one of these
* takes a reference on INSTMEM itself, causing it to never be
* freed. We drop all the self-references here to avoid this.
*/
if (unlikely(!priv->created))
atomic_dec(&engine->refcount);
return 0; return 0;
} }
...@@ -154,7 +145,6 @@ nv04_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -154,7 +145,6 @@ nv04_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
if (ret) if (ret)
return ret; return ret;
priv->created = true;
return 0; return 0;
} }
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
struct nv04_instmem_priv { struct nv04_instmem_priv {
struct nouveau_instmem base; struct nouveau_instmem base;
bool created;
void __iomem *iomem; void __iomem *iomem;
struct nouveau_mm heap; struct nouveau_mm heap;
......
...@@ -106,7 +106,6 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -106,7 +106,6 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
if (ret) if (ret)
return ret; return ret;
priv->created = true;
return 0; return 0;
} }
......
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