summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2015-08-20 14:54:16 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-08-28 12:40:32 +1000
commit5c15bf709eb6fb52c5bcb95d545250dde22f9625 (patch)
tree220e195d037926a81af69a985ac0312207c755ca /drivers/gpu
parent99d4d36ad673c2b4fea364f6d456718f0f701ce4 (diff)
drm/nouveau/nvif: return success from sclass even for objects without children
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/core/ioctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c
index 629ee56dd8ab..ee6ff01c2b1b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c
@@ -57,18 +57,18 @@ nvkm_ioctl_sclass(struct nvkm_handle *handle, void *data, u32 size)
} *args = data;
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);
if (nvif_unpack(args->v0, 0, 0, true)) {
nvif_ioctl(object, "sclass vers %d count %d\n",
args->v0.version, args->v0.count);
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);
+ } else {
+ ret = 0;
+ }
if (ret >= 0) {
args->v0.count = ret;
ret = 0;