summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvif/object.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-08-25 11:01:46 +0100
committerMark Brown <broonie@kernel.org>2020-08-25 11:01:46 +0100
commit3bec5b6aae830355e786e204b20a7cea38c3a8ed (patch)
treefd597b87faf55ceb2a207ee94f4feca6276696db /drivers/gpu/drm/nouveau/nvif/object.c
parenta577f3456c0a2fac3dee037c483753e6e68f3e49 (diff)
parentd012a7190fc1fd72ed48911e77ca97ba4521bccd (diff)
Merge tag 'v5.9-rc2' into regulator-5.9
Linux 5.9-rc2
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvif/object.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvif/object.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/object.c b/drivers/gpu/drm/nouveau/nvif/object.c
index ef3f62840e83..671a5c0199e0 100644
--- a/drivers/gpu/drm/nouveau/nvif/object.c
+++ b/drivers/gpu/drm/nouveau/nvif/object.c
@@ -242,7 +242,7 @@ nvif_object_map(struct nvif_object *object, void *argv, u32 argc)
}
void
-nvif_object_fini(struct nvif_object *object)
+nvif_object_dtor(struct nvif_object *object)
{
struct {
struct nvif_ioctl_v0 ioctl;
@@ -260,8 +260,8 @@ nvif_object_fini(struct nvif_object *object)
}
int
-nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
- void *data, u32 size, struct nvif_object *object)
+nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
+ s32 oclass, void *data, u32 size, struct nvif_object *object)
{
struct {
struct nvif_ioctl_v0 ioctl;
@@ -270,6 +270,7 @@ nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
int ret = 0;
object->client = NULL;
+ object->name = name ? name : "nvifObject";
object->handle = handle;
object->oclass = oclass;
object->map.ptr = NULL;
@@ -277,10 +278,12 @@ nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
if (parent) {
if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) {
- nvif_object_fini(object);
+ nvif_object_dtor(object);
return -ENOMEM;
}
+ object->parent = parent->parent;
+
args->ioctl.version = 0;
args->ioctl.type = NVIF_IOCTL_V0_NEW;
args->new.version = 0;
@@ -300,6 +303,6 @@ nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
}
if (ret)
- nvif_object_fini(object);
+ nvif_object_dtor(object);
return ret;
}