gpu: nvgpu: return -ENOSYS if no host1x

The callers of nvgpu_get_nvhost_dev() expect that if all goes well,
nvhost and syncpoint support exists. Thus if the device tree entry is
not found, return -ENOSYS instead of 0.

Bug 3394386

Change-Id: I4617aa2cfc240ade53294c26b3e8c2ce50b66913
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2608549
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Konsta Hölttä
2021-10-11 11:11:55 +03:00
committed by mobile promotions
parent b8e24b749e
commit a28612220a
2 changed files with 2 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ int nvgpu_get_nvhost_dev(struct gk20a *g)
nvgpu_warn(g, "host1x reference not found. assuming no syncpoints support");
nvgpu_set_enabled(g, NVGPU_HAS_SYNCPOINTS, false);
}
return 0;
return -ENOSYS;
}
g->nvhost = nvgpu_kzalloc(g, sizeof(struct nvgpu_nvhost_dev));

View File

@@ -48,7 +48,7 @@ int nvgpu_get_nvhost_dev(struct gk20a *g)
if (!np) {
nvgpu_warn(g, "Failed to find host1x, syncpt support disabled");
nvgpu_set_enabled(g, NVGPU_HAS_SYNCPOINTS, false);
return 0;
return -ENOSYS;
}
host1x_pdev = of_find_device_by_node(np);