Commit 5c15bf70 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/nvif: return success from sclass even for objects without children

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 99d4d36a
...@@ -57,18 +57,18 @@ nvkm_ioctl_sclass(struct nvkm_handle *handle, void *data, u32 size) ...@@ -57,18 +57,18 @@ nvkm_ioctl_sclass(struct nvkm_handle *handle, void *data, u32 size)
} *args = data; } *args = data;
int ret; int ret;
if (!nv_iclass(object, NV_PARENT_CLASS)) {
nvif_debug(object, "cannot have children (sclass)\n");
return -ENODEV;
}
nvif_ioctl(object, "sclass size %d\n", size); nvif_ioctl(object, "sclass size %d\n", size);
if (nvif_unpack(args->v0, 0, 0, true)) { if (nvif_unpack(args->v0, 0, 0, true)) {
nvif_ioctl(object, "sclass vers %d count %d\n", nvif_ioctl(object, "sclass vers %d count %d\n",
args->v0.version, args->v0.count); args->v0.version, args->v0.count);
if (size == args->v0.count * sizeof(args->v0.oclass[0])) { if (size == args->v0.count * sizeof(args->v0.oclass[0])) {
ret = nvkm_parent_lclass(object, args->v0.oclass, if (nv_iclass(object, NV_PARENT_CLASS)) {
ret = nvkm_parent_lclass(object,
args->v0.oclass,
args->v0.count); args->v0.count);
} else {
ret = 0;
}
if (ret >= 0) { if (ret >= 0) {
args->v0.count = ret; args->v0.count = ret;
ret = 0; ret = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment