From patchwork Fri Sep 25 18:30:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 255609 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5169C47423 for ; Fri, 25 Sep 2020 18:32:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9106223119 for ; Fri, 25 Sep 2020 18:32:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="vj2M2wWW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729868AbgIYScM (ORCPT ); Fri, 25 Sep 2020 14:32:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729741AbgIYScM (ORCPT ); Fri, 25 Sep 2020 14:32:12 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06EC6C0613D3 for ; Fri, 25 Sep 2020 11:32:12 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id u24so3323131pgi.1 for ; Fri, 25 Sep 2020 11:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8qP8UftSsHxdL7ED5s6PZmr6rYJeJgUnKrylhIp3fxM=; b=vj2M2wWW93RKQ0hijxIIb6nHC2viexpsQjfLe113yiJ/ryesi5Z8T2pk6HDumXnLvi wKcUsTtgXt2/Yfbl3g5UH5RWMem/Oo5xP2oSUq87pv28/0MjO1o3e5WKashLMOLqK811 ZuX0b3ofILzt1LOZsf3Yu66C8oS/RLipudpd/PQ2U74qRMWsjms7HIUtzi35StIiWqWc bWdPnxqIek36zgszaKsRxN9I7DR0VBXxzptaR3SJy8bD5A8v78qf377cf4MTC/FfUPwQ wh7/XaKe4QMq0fhAmn5jJffmngi1ZO12SFPTCr+LWthP96g/oKZiVP+RCiBIMfPvmzOK X7Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8qP8UftSsHxdL7ED5s6PZmr6rYJeJgUnKrylhIp3fxM=; b=b9/IQWOEk66PE+iHS1vpI4pRBHG/S9xRkUhxYzqOo6Zd07IxGLkYYHlk5rRfBcmRdf H5AvVt4d44d03jVVSkOhD8a2jpNYNCXj0PHPR44W4MVehLdH30DcLhw9CmXhOC4+8P9m gIreqo80ZIaG084WT1HvGUI+ahG1wWQEwttWqmGxm6KetiCF4RzlOhAyBp+8SBzkBbI3 YP2E6zLrBIk00/IKFO3K9gi8SahsvpIEF19hMmkZ6R43YzYUhF5eihKske41hVWKbV+B QTWc+w94/ZRScKFLt+aFyBZBrT5oFqRAnD5HhIkcLRD29inG8V3muwVIB3KGWBg4l4NA yo0g== X-Gm-Message-State: AOAM530+SVhd9zmzJucm5ZH91uy++ZNLZQn0S49NbwEhLTx7QijhQtPq fYSTja4gHMf/+h0W6XtLNR0tUg== X-Google-Smtp-Source: ABdhPJxGMunF/We/tvyk0ZOuFj4qIqvoH4wFLTM4jmkfNAeqcoCqyCo9DmOb82dgCHXYHwx87P72Rg== X-Received: by 2002:a65:5a0b:: with SMTP id y11mr194992pgs.395.1601058731455; Fri, 25 Sep 2020 11:32:11 -0700 (PDT) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id r16sm2554546pjo.19.2020.09.25.11.32.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Sep 2020 11:32:11 -0700 (PDT) From: Corentin Labbe To: gregkh@linuxfoundation.org, mchehab@kernel.org, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Corentin Labbe Subject: [PATCH RFT/RFC v2 09/47] staging: media: zoran: convert dprintk info to pci_info Date: Fri, 25 Sep 2020 18:30:19 +0000 Message-Id: <1601058657-14042-10-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601058657-14042-1-git-send-email-clabbe@baylibre.com> References: <1601058657-14042-1-git-send-email-clabbe@baylibre.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch convert dprintk(info) to pci_info (or pci_dbg if the message is not important). Signed-off-by: Corentin Labbe --- drivers/staging/media/zoran/zoran_card.c | 46 +++++++--------------- drivers/staging/media/zoran/zoran_device.c | 27 ++++--------- drivers/staging/media/zoran/zoran_driver.c | 34 ++++++---------- 3 files changed, 36 insertions(+), 71 deletions(-) diff --git a/drivers/staging/media/zoran/zoran_card.c b/drivers/staging/media/zoran/zoran_card.c index d0b93141df5b..f2387f4906c0 100644 --- a/drivers/staging/media/zoran/zoran_card.c +++ b/drivers/staging/media/zoran/zoran_card.c @@ -892,9 +892,9 @@ static void test_interrupts(struct zoran *zr) btwrite(0, ZR36057_ICR); btwrite(0x78000000, ZR36057_ISR); zr->testing = 0; - dprintk(5, KERN_INFO "%s: Testing interrupts...\n", ZR_DEVNAME(zr)); + pci_info(zr->pci_dev, "Testing interrupts...\n"); if (timeout) - dprintk(1, ": time spent: %d\n", 1 * HZ - timeout); + pci_info(zr->pci_dev, ": time spent: %d\n", 1 * HZ - timeout); if (zr36067_debug > 1) print_interrupts(zr); btwrite(icr, ZR36057_ICR); @@ -904,10 +904,7 @@ static int zr36057_init(struct zoran *zr) { int j, err; - dprintk(1, - KERN_INFO - "%s: %s - initializing card[%d], zr=%p\n", - ZR_DEVNAME(zr), __func__, zr->id, zr); + pci_info(zr->pci_dev, "initializing card[%d]\n", zr->id); /* default setup of all parameters which will persist between opens */ zr->user = 0; @@ -1140,18 +1137,12 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto zr_unreg; zr->revision = zr->pci_dev->revision; - dprintk(1, - KERN_INFO - "%s: Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08llx\n", - ZR_DEVNAME(zr), zr->revision < 2 ? '5' : '6', zr->revision, - zr->pci_dev->irq, (uint64_t)pci_resource_start(zr->pci_dev, 0)); - if (zr->revision >= 2) { - dprintk(1, - KERN_INFO - "%s: Subsystem vendor=0x%04x id=0x%04x\n", - ZR_DEVNAME(zr), zr->pci_dev->subsystem_vendor, - zr->pci_dev->subsystem_device); - } + pci_info(zr->pci_dev, "Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08llx\n", + zr->revision < 2 ? '5' : '6', zr->revision, + zr->pci_dev->irq, (uint64_t)pci_resource_start(zr->pci_dev, 0)); + if (zr->revision >= 2) + pci_info(zr->pci_dev, "Subsystem vendor=0x%04x id=0x%04x\n", + zr->pci_dev->subsystem_vendor, zr->pci_dev->subsystem_device); /* Use auto-detected card type? */ if (card[nr] == -1) { @@ -1215,14 +1206,13 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) &latency); need_latency = zr->revision > 1 ? 32 : 48; if (latency != need_latency) { - dprintk(2, KERN_INFO "%s: Changing PCI latency from %d to %d\n", - ZR_DEVNAME(zr), latency, need_latency); + pci_info(zr->pci_dev, "Changing PCI latency from %d to %d\n", latency, need_latency); pci_write_config_byte(zr->pci_dev, PCI_LATENCY_TIMER, need_latency); } zr36057_restart(zr); /* i2c */ - dprintk(2, KERN_INFO "%s: Initializing i2c bus...\n", ZR_DEVNAME(zr)); + pci_info(zr->pci_dev, "Initializing i2c bus...\n"); if (zoran_register_i2c(zr) < 0) { pci_err(pdev, "%s - can't initialize i2c bus\n", __func__); @@ -1238,7 +1228,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) zr->card.i2c_encoder, 0, zr->card.addrs_encoder); - dprintk(2, KERN_INFO "%s: Initializing videocodec bus...\n", ZR_DEVNAME(zr)); + pci_info(zr->pci_dev, "Initializing videocodec bus...\n"); if (zr->card.video_codec) { codec_name = codecid_to_modulename(zr->card.video_codec); @@ -1294,9 +1284,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* take care of Natoma chipset and a revision 1 zr36057 */ if ((pci_pci_problems & PCIPCI_NATOMA) && zr->revision <= 1) { zr->jpg_buffers.need_contiguous = 1; - dprintk(1, KERN_INFO - "%s: ZR36057/Natoma bug, max. buffer size is 128K\n", - ZR_DEVNAME(zr)); + pci_info(zr->pci_dev, "ZR36057/Natoma bug, max. buffer size is 128K\n"); } if (zr36057_init(zr) < 0) @@ -1365,12 +1353,8 @@ static int __init zoran_init(void) if (jpg_bufsize > (512 * 1024)) jpg_bufsize = 512 * 1024; /* Use parameter for vidmem or try to find a video card */ - if (vidmem) { - dprintk(1, - KERN_INFO - "%s: Using supplied video memory base address @ 0x%lx\n", - ZORAN_NAME, vidmem); - } + if (vidmem) + pr_info("%s: Using supplied video memory base address @ 0x%lx\n", ZORAN_NAME, vidmem); /* some mainboards might not do PCI-PCI data transfer well */ if (pci_pci_problems & (PCIPCI_FAIL | PCIAGP_FAIL | PCIPCI_ALIMAGIK)) diff --git a/drivers/staging/media/zoran/zoran_device.c b/drivers/staging/media/zoran/zoran_device.c index f090ee92f0c8..013d44801e68 100644 --- a/drivers/staging/media/zoran/zoran_device.c +++ b/drivers/staging/media/zoran/zoran_device.c @@ -118,8 +118,7 @@ int post_office_wait(struct zoran *zr) } if ((por & ZR36057_POR_POTime) && !zr->card.gws_not_connected) { /* In LML33/BUZ \GWS line is not connected, so it has always timeout set */ - dprintk(1, KERN_INFO "%s: pop timeout %08x\n", ZR_DEVNAME(zr), - por); + pci_info(zr->pci_dev, "pop timeout %08x\n", por); return -1; } @@ -218,16 +217,10 @@ void jpeg_codec_sleep(struct zoran *zr, int sleep) { GPIO(zr, zr->card.gpio[ZR_GPIO_JPEG_SLEEP], !sleep); if (!sleep) { - dprintk(3, - KERN_INFO - "%s: %s() - wake GPIO=0x%08x\n", - ZR_DEVNAME(zr), __func__, btread(ZR36057_GPPGCR1)); + pci_dbg(zr->pci_dev, "%s() - wake GPIO=0x%08x\n", __func__, btread(ZR36057_GPPGCR1)); udelay(500); } else { - dprintk(3, - KERN_INFO - "%s: %s() - sleep GPIO=0x%08x\n", - ZR_DEVNAME(zr), __func__, btread(ZR36057_GPPGCR1)); + pci_dbg(zr->pci_dev, "%s() - sleep GPIO=0x%08x\n", __func__, btread(ZR36057_GPPGCR1)); udelay(2); } } @@ -309,8 +302,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height, Wa = tvn->Wa; Ha = tvn->Ha; - dprintk(2, KERN_INFO "%s: set_vfe() - width = %d, height = %d\n", - ZR_DEVNAME(zr), video_width, video_height); + pci_info(zr->pci_dev, "set_vfe() - width = %d, height = %d\n", video_width, video_height); if (video_width < BUZ_MIN_WIDTH || video_height < BUZ_MIN_HEIGHT || @@ -948,8 +940,7 @@ void zr36057_enable_jpg(struct zoran *zr, enum zoran_codec_mode mode) zr36057_set_jpg(zr, mode); // \P_Reset, ... Video param, FIFO clear_interrupt_counters(zr); - dprintk(2, KERN_INFO "%s: enable_jpg(MOTION_COMPRESS)\n", - ZR_DEVNAME(zr)); + pci_info(zr->pci_dev, "enable_jpg(MOTION_COMPRESS)\n"); break; } @@ -978,8 +969,7 @@ void zr36057_enable_jpg(struct zoran *zr, enum zoran_codec_mode mode) zr36057_set_jpg(zr, mode); // \P_Reset, ... Video param, FIFO clear_interrupt_counters(zr); - dprintk(2, KERN_INFO "%s: enable_jpg(MOTION_DECOMPRESS)\n", - ZR_DEVNAME(zr)); + pci_info(zr->pci_dev, "enable_jpg(MOTION_DECOMPRESS)\n"); break; case BUZ_MODE_IDLE: @@ -1006,7 +996,7 @@ void zr36057_enable_jpg(struct zoran *zr, enum zoran_codec_mode mode) decoder_call(zr, video, s_stream, 1); encoder_call(zr, video, s_routing, 0, 0, 0); - dprintk(2, KERN_INFO "%s: enable_jpg(IDLE)\n", ZR_DEVNAME(zr)); + pci_info(zr->pci_dev, "enable_jpg(IDLE)\n"); break; } } @@ -1128,8 +1118,7 @@ static void zoran_restart(struct zoran *zr) jpeg_start(zr); if (zr->num_errors <= 8) - dprintk(2, KERN_INFO "%s: Restart\n", - ZR_DEVNAME(zr)); + pci_info(zr->pci_dev, "Restart\n"); zr->JPEG_missed = 0; zr->JPEG_error = 2; diff --git a/drivers/staging/media/zoran/zoran_driver.c b/drivers/staging/media/zoran/zoran_driver.c index aed2ac82bfee..226a99d002c0 100644 --- a/drivers/staging/media/zoran/zoran_driver.c +++ b/drivers/staging/media/zoran/zoran_driver.c @@ -225,11 +225,8 @@ static int v4l_fbuffer_alloc(struct zoran_fh *fh) for (off = 0; off < fh->buffers.buffer_size; off += PAGE_SIZE) SetPageReserved(virt_to_page(mem + off)); - dprintk(4, - KERN_INFO - "%s: %s - V4L frame %d mem %p (bus: 0x%llx)\n", - ZR_DEVNAME(zr), __func__, i, mem, - (unsigned long long)virt_to_bus(mem)); + pci_info(zr->pci_dev, "%s - V4L frame %d mem %p (bus: 0x%llx)\n", __func__, i, mem, + (unsigned long long)virt_to_bus(mem)); } fh->buffers.allocated = 1; @@ -244,7 +241,7 @@ static void v4l_fbuffer_free(struct zoran_fh *fh) int i, off; unsigned char *mem; - dprintk(4, KERN_INFO "%s: %s\n", ZR_DEVNAME(zr), __func__); + pci_dbg(zr->pci_dev, "%s\n", __func__); for (i = 0; i < fh->buffers.num_buffers; i++) { if (!fh->buffers.buffer[i].v4l.fbuffer) @@ -820,8 +817,8 @@ static int zoran_open(struct file *file) struct zoran_fh *fh; int res, first_open = 0; - dprintk(2, KERN_INFO "%s: %s(%s, pid=[%d]), users(-)=%d\n", - ZR_DEVNAME(zr), __func__, current->comm, task_pid_nr(current), zr->user + 1); + pci_info(zr->pci_dev, "%s(%s, pid=[%d]), users(-)=%d\n", __func__, current->comm, + task_pid_nr(current), zr->user + 1); mutex_lock(&zr->lock); @@ -876,8 +873,7 @@ static int zoran_open(struct file *file) fail_unlock: mutex_unlock(&zr->lock); - dprintk(2, KERN_INFO "%s: open failed (%d), users(-)=%d\n", - ZR_DEVNAME(zr), res, zr->user); + pci_info(zr->pci_dev, "open failed (%d), users(-)=%d\n", res, zr->user); return res; } @@ -887,8 +883,8 @@ static int zoran_close(struct file *file) struct zoran_fh *fh = file->private_data; struct zoran *zr = fh->zr; - dprintk(2, KERN_INFO "%s: %s(%s, pid=[%d]), users(+)=%d\n", - ZR_DEVNAME(zr), __func__, current->comm, task_pid_nr(current), zr->user - 1); + pci_info(zr->pci_dev, "%s(%s, pid=[%d]), users(+)=%d\n", __func__, current->comm, + task_pid_nr(current), zr->user - 1); /* kernel locks (fs/device.c), so don't do that ourselves * (prevents deadlocks) */ @@ -933,7 +929,7 @@ static int zoran_close(struct file *file) kfree(fh->overlay_mask); kfree(fh); - dprintk(4, KERN_INFO "%s: %s done\n", ZR_DEVNAME(zr), __func__); + pci_dbg(zr->pci_dev, "%s done\n", __func__); return 0; } @@ -2390,8 +2386,7 @@ static void zoran_vm_close(struct vm_area_struct *vma) struct zoran *zr = fh->zr; int i; - dprintk(3, KERN_INFO "%s: %s - munmap(%s)\n", ZR_DEVNAME(zr), - __func__, mode_name(fh->map_mode)); + pci_info(zr->pci_dev, "%s - munmap(%s)\n", ZR_DEVNAME(zr), mode_name(fh->map_mode)); for (i = 0; i < fh->buffers.num_buffers; i++) { if (fh->buffers.buffer[i].map == map) @@ -2405,8 +2400,7 @@ static void zoran_vm_close(struct vm_area_struct *vma) return; } - dprintk(3, KERN_INFO "%s: %s - free %s buffers\n", ZR_DEVNAME(zr), - __func__, mode_name(fh->map_mode)); + pci_info(zr->pci_dev, "%s - free %s buffers\n", __func__, mode_name(fh->map_mode)); if (fh->map_mode == ZORAN_MAP_MODE_RAW) { if (fh->buffers.active != ZORAN_FREE) { @@ -2446,10 +2440,8 @@ static int zoran_mmap(struct file *file, struct vm_area_struct *vma) struct zoran_mapping *map; int res = 0; - dprintk(3, - KERN_INFO "%s: %s(%s) of 0x%08lx-0x%08lx (size=%lu)\n", - ZR_DEVNAME(zr), __func__, - mode_name(fh->map_mode), vma->vm_start, vma->vm_end, size); + pci_info(zr->pci_dev, "%s(%s) of 0x%08lx-0x%08lx (size=%lu)\n", __func__, + mode_name(fh->map_mode), vma->vm_start, vma->vm_end, size); if (!(vma->vm_flags & VM_SHARED) || !(vma->vm_flags & VM_READ) || !(vma->vm_flags & VM_WRITE)) {