aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvif
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-03-30 13:51:38 +1000
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 18:50:50 +1000
commitb495396cc9ccf579e5c7bba47137c0f867ddf580 (patch)
treebf330de296740f662f378af0e7c2af534f0b0992 /drivers/gpu/drm/nouveau/nvif
parentdrm/nouveau/nvif: give every device object a human-readable identifier (diff)
downloadlinux-dev-b495396cc9ccf579e5c7bba47137c0f867ddf580.tar.xz
linux-dev-b495396cc9ccf579e5c7bba47137c0f867ddf580.zip
drm/nouveau/nvif: give every mmu object a human-readable identifier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvif')
-rw-r--r--drivers/gpu/drm/nouveau/nvif/mmu.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/mmu.c b/drivers/gpu/drm/nouveau/nvif/mmu.c
index aa6ec915d603..3709cbbc19a1 100644
--- a/drivers/gpu/drm/nouveau/nvif/mmu.c
+++ b/drivers/gpu/drm/nouveau/nvif/mmu.c
@@ -25,7 +25,7 @@
#include <nvif/if0008.h>
void
-nvif_mmu_fini(struct nvif_mmu *mmu)
+nvif_mmu_dtor(struct nvif_mmu *mmu)
{
kfree(mmu->kind);
kfree(mmu->type);
@@ -34,7 +34,8 @@ nvif_mmu_fini(struct nvif_mmu *mmu)
}
int
-nvif_mmu_init(struct nvif_object *parent, s32 oclass, struct nvif_mmu *mmu)
+nvif_mmu_ctor(struct nvif_object *parent, const char *name, s32 oclass,
+ struct nvif_mmu *mmu)
{
static const struct nvif_mclass mems[] = {
{ NVIF_CLASS_MEM_GF100, -1 },
@@ -50,8 +51,8 @@ nvif_mmu_init(struct nvif_object *parent, s32 oclass, struct nvif_mmu *mmu)
mmu->type = NULL;
mmu->kind = NULL;
- ret = nvif_object_ctor(parent, "nvifMmu", 0, oclass, &args,
- sizeof(args), &mmu->object);
+ ret = nvif_object_ctor(parent, name ? name : "nvifMmu", 0, oclass,
+ &args, sizeof(args), &mmu->object);
if (ret)
goto done;
@@ -127,6 +128,6 @@ nvif_mmu_init(struct nvif_object *parent, s32 oclass, struct nvif_mmu *mmu)
done:
if (ret)
- nvif_mmu_fini(mmu);
+ nvif_mmu_dtor(mmu);
return ret;
}