drm/nouveau/nvif: add wrapper for open-coded nvif_object_constructed()

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Ben Skeggs 2022-06-01 20:46:00 +10:00 committed by Dave Airlie
parent d9e019bb39
commit 911dd554a1
2 changed files with 7 additions and 1 deletions

View File

@ -22,6 +22,12 @@ struct nvif_object {
} map;
};
static inline bool
nvif_object_constructed(struct nvif_object *object)
{
return object->client != NULL;
}
int nvif_object_ctor(struct nvif_object *, const char *name, u32 handle,
s32 oclass, void *, u32, struct nvif_object *);
void nvif_object_dtor(struct nvif_object *);

View File

@ -250,7 +250,7 @@ nvif_object_dtor(struct nvif_object *object)
.ioctl.type = NVIF_IOCTL_V0_DEL,
};
if (!object->client)
if (!nvif_object_constructed(object))
return;
nvif_object_unmap(object);