diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-12-23 01:08:00 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-01-23 13:39:10 +1000 |
commit | ab606194d1f5821b0052823fc6b6330a029b3d95 (patch) | |
tree | a695e5aa88f04c7c452f8d81baf89ca0923c1fac /drivers/gpu/drm/nouveau/core/subdev/instmem/base.c | |
parent | drm/nouveau/instmem: tidy up the subdev class definition (diff) | |
download | linux-dev-ab606194d1f5821b0052823fc6b6330a029b3d95.tar.xz linux-dev-ab606194d1f5821b0052823fc6b6330a029b3d95.zip |
drm/nouveau/instmem: tidy up the object class definition
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.c | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c index 5f5abf564ade..14706d9842ca 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/base.c @@ -24,6 +24,23 @@ #include "priv.h" +/****************************************************************************** + * instmem object base implementation + *****************************************************************************/ + +void +_nouveau_instobj_dtor(struct nouveau_object *object) +{ + struct nouveau_instmem *imem = (void *)object->engine; + struct nouveau_instobj *iobj = (void *)object; + + mutex_lock(&nv_subdev(imem)->mutex); + list_del(&iobj->head); + mutex_unlock(&nv_subdev(imem)->mutex); + + return nouveau_object_destroy(&iobj->base); +} + int nouveau_instobj_create_(struct nouveau_object *parent, struct nouveau_object *engine, @@ -46,25 +63,6 @@ nouveau_instobj_create_(struct nouveau_object *parent, return 0; } -void -nouveau_instobj_destroy(struct nouveau_instobj *iobj) -{ - struct nouveau_subdev *subdev = nv_subdev(iobj->base.engine); - - mutex_lock(&subdev->mutex); - list_del(&iobj->head); - mutex_unlock(&subdev->mutex); - - return nouveau_object_destroy(&iobj->base); -} - -void -_nouveau_instobj_dtor(struct nouveau_object *object) -{ - struct nouveau_instobj *iobj = (void *)object; - return nouveau_instobj_destroy(iobj); -} - /****************************************************************************** * instmem subdev base implementation *****************************************************************************/ @@ -76,14 +74,9 @@ nouveau_instmem_alloc(struct nouveau_instmem *imem, { struct nouveau_object *engine = nv_object(imem); struct nouveau_instmem_impl *impl = (void *)engine->oclass; - int ret; - - ret = nouveau_object_ctor(parent, engine, impl->instobj, - (void *)(unsigned long)align, size, pobject); - if (ret) - return ret; - - return 0; + struct nouveau_instobj_args args = { .size = size, .align = align }; + return nouveau_object_ctor(parent, engine, impl->instobj, &args, + sizeof(args), pobject); } int |