From 6f0fcbc667ca55ed25818467069853e6d750cd7d Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 22 Jun 2017 13:15:17 -0700 Subject: gpu: nvgpu: Convert logging from dev_*() to nvgpu_*() Convert a few calls from dev_*() logging to nvgpu_*(). This reduces dependency to Linux specific struct device pointer. JIRA NVGPU-38 Change-Id: Ib51a6b1287db25b7dd4d164aec3ac75fa2801ebf Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master/r/1507929 GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/linux/driver_common.c | 8 ++++---- drivers/gpu/nvgpu/common/linux/ioctl_as.c | 1 - drivers/gpu/nvgpu/common/linux/nvhost.c | 4 ++-- drivers/gpu/nvgpu/common/linux/timers.c | 6 ++---- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 2 +- drivers/gpu/nvgpu/vgpu/css_vgpu.c | 12 ++++++------ drivers/gpu/nvgpu/vgpu/vgpu.c | 7 +++---- 7 files changed, 18 insertions(+), 22 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index a7bc230c..eb4f490f 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c @@ -165,9 +165,9 @@ int nvgpu_probe(struct gk20a *g, err = platform->probe(g->dev); if (err) { if (err == -EPROBE_DEFER) - dev_info(g->dev, "platform probe failed"); + nvgpu_info(g, "platform probe failed"); else - dev_err(g->dev, "platform probe failed"); + nvgpu_err(g, "platform probe failed"); return err; } @@ -184,7 +184,7 @@ int nvgpu_probe(struct gk20a *g, if (platform->late_probe) { err = platform->late_probe(g->dev); if (err) { - dev_err(g->dev, "late probe failed"); + nvgpu_err(g, "late probe failed"); return err; } } @@ -196,7 +196,7 @@ int nvgpu_probe(struct gk20a *g, g->dbg_regops_tmp_buf = nvgpu_kzalloc(g, SZ_4K); if (!g->dbg_regops_tmp_buf) { - dev_err(g->dev, "couldn't allocate regops tmp buf"); + nvgpu_err(g, "couldn't allocate regops tmp buf"); return -ENOMEM; } g->dbg_regops_tmp_buf_ops = diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_as.c b/drivers/gpu/nvgpu/common/linux/ioctl_as.c index 405301ee..273024bd 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_as.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_as.c @@ -377,7 +377,6 @@ long gk20a_as_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) (struct nvgpu_as_map_buffer_batch_args *)buf); break; default: - dev_dbg(dev_from_gk20a(g), "unrecognized as ioctl: 0x%x", cmd); err = -ENOTTY; break; } diff --git a/drivers/gpu/nvgpu/common/linux/nvhost.c b/drivers/gpu/nvgpu/common/linux/nvhost.c index e190096e..96865f7d 100644 --- a/drivers/gpu/nvgpu/common/linux/nvhost.c +++ b/drivers/gpu/nvgpu/common/linux/nvhost.c @@ -37,13 +37,13 @@ int nvgpu_get_nvhost_dev(struct gk20a *g) host1x_pdev = of_find_device_by_node(host1x_node); if (!host1x_pdev) { - dev_warn(g->dev, "host1x device not available"); + nvgpu_warn(g, "host1x device not available"); return -EPROBE_DEFER; } } else { if (g->has_syncpoints) { - dev_warn(g->dev, "host1x reference not found. assuming no syncpoints support\n"); + nvgpu_warn(g, "host1x reference not found. assuming no syncpoints support"); g->has_syncpoints = false; } return 0; diff --git a/drivers/gpu/nvgpu/common/linux/timers.c b/drivers/gpu/nvgpu/common/linux/timers.c index cfebb799..2953902e 100644 --- a/drivers/gpu/nvgpu/common/linux/timers.c +++ b/drivers/gpu/nvgpu/common/linux/timers.c @@ -97,8 +97,7 @@ static int __nvgpu_timeout_expired_msg_cpu(struct nvgpu_timeout *timeout, vsnprintf(buf, sizeof(buf), fmt, args); - dev_err(dev_from_gk20a(g), - "Timeout detected @ %pF %s\n", caller, buf); + nvgpu_err(g, "Timeout detected @ %pF %s", caller, buf); } return -ETIMEDOUT; @@ -122,8 +121,7 @@ static int __nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout, vsnprintf(buf, sizeof(buf), fmt, args); - dev_err(dev_from_gk20a(g), - "No more retries @ %pF %s\n", caller, buf); + nvgpu_err(g, "No more retries @ %pF %s", caller, buf); } return -ETIMEDOUT; diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 52053c14..9cc4f58e 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -2050,7 +2050,7 @@ int nvgpu_vm_map_buffer(struct vm_gk20a *vm, /* get ref to the mem handle (released on unmap_locked) */ dmabuf = dma_buf_get(dmabuf_fd); if (IS_ERR(dmabuf)) { - dev_warn(dev_from_vm(vm), "%s: fd %d is not a dmabuf", + nvgpu_warn(gk20a_from_vm(vm), "%s: fd %d is not a dmabuf", __func__, dmabuf_fd); return PTR_ERR(dmabuf); } diff --git a/drivers/gpu/nvgpu/vgpu/css_vgpu.c b/drivers/gpu/nvgpu/vgpu/css_vgpu.c index cca8766b..d18ed100 100644 --- a/drivers/gpu/nvgpu/vgpu/css_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/css_vgpu.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -46,7 +46,7 @@ static int vgpu_css_init_snapshot_buffer(struct gr_gk20a *gr) err = of_parse_phandle_with_fixed_args(np, "mempool-css", 1, 0, &args); if (err) { - dev_info(dev_from_gk20a(g), "dt missing mempool-css\n"); + nvgpu_info(g, "dt missing mempool-css"); goto fail; } @@ -54,15 +54,15 @@ static int vgpu_css_init_snapshot_buffer(struct gr_gk20a *gr) mempool = args.args[0]; css_cookie = tegra_hv_mempool_reserve(hv_np, mempool); if (IS_ERR(css_cookie)) { - dev_info(dev_from_gk20a(g), - "mempool %u reserve failed\n", mempool); + nvgpu_info(g, + "mempool %u reserve failed", mempool); err = -EINVAL; goto fail; } /* Make sure buffer size is large enough */ if (css_cookie->size < CSS_MIN_HW_SNAPSHOT_SIZE) { - dev_info(dev_from_gk20a(g), "mempool size %lld too small\n", + nvgpu_info(g, "mempool size %lld too small", css_cookie->size); err = -ENOMEM; goto fail; @@ -74,7 +74,7 @@ static int vgpu_css_init_snapshot_buffer(struct gr_gk20a *gr) buf = ioremap_cache(css_cookie->ipa, css_cookie->size); #endif if (!buf) { - dev_info(dev_from_gk20a(g), "ioremap_cache failed\n"); + nvgpu_info(g, "ioremap_cache failed"); err = -EINVAL; goto fail; } diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index d41c0abb..da77dc19 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -268,7 +268,7 @@ static int vgpu_init_support(struct platform_device *pdev) int err = 0; if (!r) { - dev_err(dev_from_gk20a(g), "faield to get gk20a bar1\n"); + nvgpu_err(g, "failed to get gk20a bar1"); err = -ENXIO; goto fail; } @@ -276,8 +276,7 @@ static int vgpu_init_support(struct platform_device *pdev) if (r->name && !strcmp(r->name, "/vgpu")) { regs = devm_ioremap_resource(&pdev->dev, r); if (IS_ERR(regs)) { - dev_err(dev_from_gk20a(g), - "failed to remap gk20a regs\n"); + nvgpu_err(g, "failed to remap gk20a bar1"); err = PTR_ERR(regs); goto fail; } @@ -292,7 +291,7 @@ static int vgpu_init_support(struct platform_device *pdev) g->dbg_regops_tmp_buf = nvgpu_kzalloc(g, SZ_4K); if (!g->dbg_regops_tmp_buf) { - dev_err(g->dev, "couldn't allocate regops tmp buf"); + nvgpu_err(g, "couldn't allocate regops tmp buf"); return -ENOMEM; } g->dbg_regops_tmp_buf_ops = -- cgit v1.2.2