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:
parent
d9e019bb39
commit
911dd554a1
|
@ -22,6 +22,12 @@ struct nvif_object {
|
||||||
} map;
|
} 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,
|
int nvif_object_ctor(struct nvif_object *, const char *name, u32 handle,
|
||||||
s32 oclass, void *, u32, struct nvif_object *);
|
s32 oclass, void *, u32, struct nvif_object *);
|
||||||
void nvif_object_dtor(struct nvif_object *);
|
void nvif_object_dtor(struct nvif_object *);
|
||||||
|
|
|
@ -250,7 +250,7 @@ nvif_object_dtor(struct nvif_object *object)
|
||||||
.ioctl.type = NVIF_IOCTL_V0_DEL,
|
.ioctl.type = NVIF_IOCTL_V0_DEL,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!object->client)
|
if (!nvif_object_constructed(object))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nvif_object_unmap(object);
|
nvif_object_unmap(object);
|
||||||
|
|
Loading…
Reference in New Issue