From a28612220ab34697d407e4503527d9cef84185d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konsta=20H=C3=B6ltt=C3=A4?= Date: Mon, 11 Oct 2021 11:11:55 +0300 Subject: [PATCH] gpu: nvgpu: return -ENOSYS if no host1x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ä Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2608549 Reviewed-by: Alex Waterman Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/nvhost.c | 2 +- drivers/gpu/nvgpu/os/linux/nvhost_host1x.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/nvhost.c b/drivers/gpu/nvgpu/os/linux/nvhost.c index ac56fd6b6..948ca9cc4 100644 --- a/drivers/gpu/nvgpu/os/linux/nvhost.c +++ b/drivers/gpu/nvgpu/os/linux/nvhost.c @@ -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)); diff --git a/drivers/gpu/nvgpu/os/linux/nvhost_host1x.c b/drivers/gpu/nvgpu/os/linux/nvhost_host1x.c index f9cd0b70e..d8014da25 100644 --- a/drivers/gpu/nvgpu/os/linux/nvhost_host1x.c +++ b/drivers/gpu/nvgpu/os/linux/nvhost_host1x.c @@ -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);