Commit 9bb27202 authored by Corentin Labbe's avatar Corentin Labbe Committed by Mauro Carvalho Chehab

media: zoran: convert dprintk info to pci_info

This patch convert dprintk(info) to pci_info (or pci_dbg if the message
is not important).
Signed-off-by: default avatarCorentin Labbe <clabbe@baylibre.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 28ea0148
...@@ -892,9 +892,9 @@ static void test_interrupts(struct zoran *zr) ...@@ -892,9 +892,9 @@ static void test_interrupts(struct zoran *zr)
btwrite(0, ZR36057_ICR); btwrite(0, ZR36057_ICR);
btwrite(0x78000000, ZR36057_ISR); btwrite(0x78000000, ZR36057_ISR);
zr->testing = 0; zr->testing = 0;
dprintk(5, KERN_INFO "%s: Testing interrupts...\n", ZR_DEVNAME(zr)); pci_info(zr->pci_dev, "Testing interrupts...\n");
if (timeout) 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) if (zr36067_debug > 1)
print_interrupts(zr); print_interrupts(zr);
btwrite(icr, ZR36057_ICR); btwrite(icr, ZR36057_ICR);
...@@ -904,10 +904,7 @@ static int zr36057_init(struct zoran *zr) ...@@ -904,10 +904,7 @@ static int zr36057_init(struct zoran *zr)
{ {
int j, err; int j, err;
dprintk(1, pci_info(zr->pci_dev, "initializing card[%d]\n", zr->id);
KERN_INFO
"%s: %s - initializing card[%d], zr=%p\n",
ZR_DEVNAME(zr), __func__, zr->id, zr);
/* default setup of all parameters which will persist between opens */ /* default setup of all parameters which will persist between opens */
zr->user = 0; zr->user = 0;
...@@ -1140,18 +1137,12 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1140,18 +1137,12 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto zr_unreg; goto zr_unreg;
zr->revision = zr->pci_dev->revision; zr->revision = zr->pci_dev->revision;
dprintk(1, pci_info(zr->pci_dev, "Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08llx\n",
KERN_INFO zr->revision < 2 ? '5' : '6', zr->revision,
"%s: Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08llx\n", zr->pci_dev->irq, (uint64_t)pci_resource_start(zr->pci_dev, 0));
ZR_DEVNAME(zr), zr->revision < 2 ? '5' : '6', zr->revision, if (zr->revision >= 2)
zr->pci_dev->irq, (uint64_t)pci_resource_start(zr->pci_dev, 0)); pci_info(zr->pci_dev, "Subsystem vendor=0x%04x id=0x%04x\n",
if (zr->revision >= 2) { zr->pci_dev->subsystem_vendor, zr->pci_dev->subsystem_device);
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);
}
/* Use auto-detected card type? */ /* Use auto-detected card type? */
if (card[nr] == -1) { if (card[nr] == -1) {
...@@ -1215,14 +1206,13 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1215,14 +1206,13 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
&latency); &latency);
need_latency = zr->revision > 1 ? 32 : 48; need_latency = zr->revision > 1 ? 32 : 48;
if (latency != need_latency) { if (latency != need_latency) {
dprintk(2, KERN_INFO "%s: Changing PCI latency from %d to %d\n", pci_info(zr->pci_dev, "Changing PCI latency from %d to %d\n", latency, need_latency);
ZR_DEVNAME(zr), latency, need_latency);
pci_write_config_byte(zr->pci_dev, PCI_LATENCY_TIMER, need_latency); pci_write_config_byte(zr->pci_dev, PCI_LATENCY_TIMER, need_latency);
} }
zr36057_restart(zr); zr36057_restart(zr);
/* i2c */ /* 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) { if (zoran_register_i2c(zr) < 0) {
pci_err(pdev, "%s - can't initialize i2c bus\n", __func__); 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) ...@@ -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.i2c_encoder, 0,
zr->card.addrs_encoder); 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) { if (zr->card.video_codec) {
codec_name = codecid_to_modulename(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) ...@@ -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 */ /* take care of Natoma chipset and a revision 1 zr36057 */
if ((pci_pci_problems & PCIPCI_NATOMA) && zr->revision <= 1) { if ((pci_pci_problems & PCIPCI_NATOMA) && zr->revision <= 1) {
zr->jpg_buffers.need_contiguous = 1; zr->jpg_buffers.need_contiguous = 1;
dprintk(1, KERN_INFO pci_info(zr->pci_dev, "ZR36057/Natoma bug, max. buffer size is 128K\n");
"%s: ZR36057/Natoma bug, max. buffer size is 128K\n",
ZR_DEVNAME(zr));
} }
if (zr36057_init(zr) < 0) if (zr36057_init(zr) < 0)
...@@ -1365,12 +1353,8 @@ static int __init zoran_init(void) ...@@ -1365,12 +1353,8 @@ static int __init zoran_init(void)
if (jpg_bufsize > (512 * 1024)) if (jpg_bufsize > (512 * 1024))
jpg_bufsize = 512 * 1024; jpg_bufsize = 512 * 1024;
/* Use parameter for vidmem or try to find a video card */ /* Use parameter for vidmem or try to find a video card */
if (vidmem) { if (vidmem)
dprintk(1, pr_info("%s: Using supplied video memory base address @ 0x%lx\n", ZORAN_NAME, vidmem);
KERN_INFO
"%s: Using supplied video memory base address @ 0x%lx\n",
ZORAN_NAME, vidmem);
}
/* some mainboards might not do PCI-PCI data transfer well */ /* some mainboards might not do PCI-PCI data transfer well */
if (pci_pci_problems & (PCIPCI_FAIL | PCIAGP_FAIL | PCIPCI_ALIMAGIK)) if (pci_pci_problems & (PCIPCI_FAIL | PCIAGP_FAIL | PCIPCI_ALIMAGIK))
......
...@@ -118,8 +118,7 @@ int post_office_wait(struct zoran *zr) ...@@ -118,8 +118,7 @@ int post_office_wait(struct zoran *zr)
} }
if ((por & ZR36057_POR_POTime) && !zr->card.gws_not_connected) { if ((por & ZR36057_POR_POTime) && !zr->card.gws_not_connected) {
/* In LML33/BUZ \GWS line is not connected, so it has always timeout set */ /* 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), pci_info(zr->pci_dev, "pop timeout %08x\n", por);
por);
return -1; return -1;
} }
...@@ -218,16 +217,10 @@ void jpeg_codec_sleep(struct zoran *zr, int sleep) ...@@ -218,16 +217,10 @@ void jpeg_codec_sleep(struct zoran *zr, int sleep)
{ {
GPIO(zr, zr->card.gpio[ZR_GPIO_JPEG_SLEEP], !sleep); GPIO(zr, zr->card.gpio[ZR_GPIO_JPEG_SLEEP], !sleep);
if (!sleep) { if (!sleep) {
dprintk(3, pci_dbg(zr->pci_dev, "%s() - wake GPIO=0x%08x\n", __func__, btread(ZR36057_GPPGCR1));
KERN_INFO
"%s: %s() - wake GPIO=0x%08x\n",
ZR_DEVNAME(zr), __func__, btread(ZR36057_GPPGCR1));
udelay(500); udelay(500);
} else { } else {
dprintk(3, pci_dbg(zr->pci_dev, "%s() - sleep GPIO=0x%08x\n", __func__, btread(ZR36057_GPPGCR1));
KERN_INFO
"%s: %s() - sleep GPIO=0x%08x\n",
ZR_DEVNAME(zr), __func__, btread(ZR36057_GPPGCR1));
udelay(2); udelay(2);
} }
} }
...@@ -309,8 +302,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height, ...@@ -309,8 +302,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
Wa = tvn->Wa; Wa = tvn->Wa;
Ha = tvn->Ha; Ha = tvn->Ha;
dprintk(2, KERN_INFO "%s: set_vfe() - width = %d, height = %d\n", pci_info(zr->pci_dev, "set_vfe() - width = %d, height = %d\n", video_width, video_height);
ZR_DEVNAME(zr), video_width, video_height);
if (video_width < BUZ_MIN_WIDTH || if (video_width < BUZ_MIN_WIDTH ||
video_height < BUZ_MIN_HEIGHT || video_height < BUZ_MIN_HEIGHT ||
...@@ -948,8 +940,7 @@ void zr36057_enable_jpg(struct zoran *zr, enum zoran_codec_mode mode) ...@@ -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 zr36057_set_jpg(zr, mode); // \P_Reset, ... Video param, FIFO
clear_interrupt_counters(zr); clear_interrupt_counters(zr);
dprintk(2, KERN_INFO "%s: enable_jpg(MOTION_COMPRESS)\n", pci_info(zr->pci_dev, "enable_jpg(MOTION_COMPRESS)\n");
ZR_DEVNAME(zr));
break; break;
} }
...@@ -978,8 +969,7 @@ void zr36057_enable_jpg(struct zoran *zr, enum zoran_codec_mode mode) ...@@ -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 zr36057_set_jpg(zr, mode); // \P_Reset, ... Video param, FIFO
clear_interrupt_counters(zr); clear_interrupt_counters(zr);
dprintk(2, KERN_INFO "%s: enable_jpg(MOTION_DECOMPRESS)\n", pci_info(zr->pci_dev, "enable_jpg(MOTION_DECOMPRESS)\n");
ZR_DEVNAME(zr));
break; break;
case BUZ_MODE_IDLE: case BUZ_MODE_IDLE:
...@@ -1006,7 +996,7 @@ void zr36057_enable_jpg(struct zoran *zr, enum zoran_codec_mode mode) ...@@ -1006,7 +996,7 @@ void zr36057_enable_jpg(struct zoran *zr, enum zoran_codec_mode mode)
decoder_call(zr, video, s_stream, 1); decoder_call(zr, video, s_stream, 1);
encoder_call(zr, video, s_routing, 0, 0, 0); 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; break;
} }
} }
...@@ -1128,8 +1118,7 @@ static void zoran_restart(struct zoran *zr) ...@@ -1128,8 +1118,7 @@ static void zoran_restart(struct zoran *zr)
jpeg_start(zr); jpeg_start(zr);
if (zr->num_errors <= 8) if (zr->num_errors <= 8)
dprintk(2, KERN_INFO "%s: Restart\n", pci_info(zr->pci_dev, "Restart\n");
ZR_DEVNAME(zr));
zr->JPEG_missed = 0; zr->JPEG_missed = 0;
zr->JPEG_error = 2; zr->JPEG_error = 2;
......
...@@ -225,11 +225,8 @@ static int v4l_fbuffer_alloc(struct zoran_fh *fh) ...@@ -225,11 +225,8 @@ static int v4l_fbuffer_alloc(struct zoran_fh *fh)
for (off = 0; off < fh->buffers.buffer_size; for (off = 0; off < fh->buffers.buffer_size;
off += PAGE_SIZE) off += PAGE_SIZE)
SetPageReserved(virt_to_page(mem + off)); SetPageReserved(virt_to_page(mem + off));
dprintk(4, pci_info(zr->pci_dev, "%s - V4L frame %d mem %p (bus: 0x%llx)\n", __func__, i, mem,
KERN_INFO (unsigned long long)virt_to_bus(mem));
"%s: %s - V4L frame %d mem %p (bus: 0x%llx)\n",
ZR_DEVNAME(zr), __func__, i, mem,
(unsigned long long)virt_to_bus(mem));
} }
fh->buffers.allocated = 1; fh->buffers.allocated = 1;
...@@ -244,7 +241,7 @@ static void v4l_fbuffer_free(struct zoran_fh *fh) ...@@ -244,7 +241,7 @@ static void v4l_fbuffer_free(struct zoran_fh *fh)
int i, off; int i, off;
unsigned char *mem; 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++) { for (i = 0; i < fh->buffers.num_buffers; i++) {
if (!fh->buffers.buffer[i].v4l.fbuffer) if (!fh->buffers.buffer[i].v4l.fbuffer)
...@@ -820,8 +817,8 @@ static int zoran_open(struct file *file) ...@@ -820,8 +817,8 @@ static int zoran_open(struct file *file)
struct zoran_fh *fh; struct zoran_fh *fh;
int res, first_open = 0; int res, first_open = 0;
dprintk(2, KERN_INFO "%s: %s(%s, pid=[%d]), users(-)=%d\n", pci_info(zr->pci_dev, "%s(%s, pid=[%d]), users(-)=%d\n", __func__, current->comm,
ZR_DEVNAME(zr), __func__, current->comm, task_pid_nr(current), zr->user + 1); task_pid_nr(current), zr->user + 1);
mutex_lock(&zr->lock); mutex_lock(&zr->lock);
...@@ -876,8 +873,7 @@ static int zoran_open(struct file *file) ...@@ -876,8 +873,7 @@ static int zoran_open(struct file *file)
fail_unlock: fail_unlock:
mutex_unlock(&zr->lock); mutex_unlock(&zr->lock);
dprintk(2, KERN_INFO "%s: open failed (%d), users(-)=%d\n", pci_info(zr->pci_dev, "open failed (%d), users(-)=%d\n", res, zr->user);
ZR_DEVNAME(zr), res, zr->user);
return res; return res;
} }
...@@ -887,8 +883,8 @@ static int zoran_close(struct file *file) ...@@ -887,8 +883,8 @@ static int zoran_close(struct file *file)
struct zoran_fh *fh = file->private_data; struct zoran_fh *fh = file->private_data;
struct zoran *zr = fh->zr; struct zoran *zr = fh->zr;
dprintk(2, KERN_INFO "%s: %s(%s, pid=[%d]), users(+)=%d\n", pci_info(zr->pci_dev, "%s(%s, pid=[%d]), users(+)=%d\n", __func__, current->comm,
ZR_DEVNAME(zr), __func__, current->comm, task_pid_nr(current), zr->user - 1); task_pid_nr(current), zr->user - 1);
/* kernel locks (fs/device.c), so don't do that ourselves /* kernel locks (fs/device.c), so don't do that ourselves
* (prevents deadlocks) */ * (prevents deadlocks) */
...@@ -933,7 +929,7 @@ static int zoran_close(struct file *file) ...@@ -933,7 +929,7 @@ static int zoran_close(struct file *file)
kfree(fh->overlay_mask); kfree(fh->overlay_mask);
kfree(fh); 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; return 0;
} }
...@@ -2390,8 +2386,7 @@ static void zoran_vm_close(struct vm_area_struct *vma) ...@@ -2390,8 +2386,7 @@ static void zoran_vm_close(struct vm_area_struct *vma)
struct zoran *zr = fh->zr; struct zoran *zr = fh->zr;
int i; int i;
dprintk(3, KERN_INFO "%s: %s - munmap(%s)\n", ZR_DEVNAME(zr), pci_info(zr->pci_dev, "%s - munmap(%s)\n", ZR_DEVNAME(zr), mode_name(fh->map_mode));
__func__, mode_name(fh->map_mode));
for (i = 0; i < fh->buffers.num_buffers; i++) { for (i = 0; i < fh->buffers.num_buffers; i++) {
if (fh->buffers.buffer[i].map == map) if (fh->buffers.buffer[i].map == map)
...@@ -2405,8 +2400,7 @@ static void zoran_vm_close(struct vm_area_struct *vma) ...@@ -2405,8 +2400,7 @@ static void zoran_vm_close(struct vm_area_struct *vma)
return; return;
} }
dprintk(3, KERN_INFO "%s: %s - free %s buffers\n", ZR_DEVNAME(zr), pci_info(zr->pci_dev, "%s - free %s buffers\n", __func__, mode_name(fh->map_mode));
__func__, mode_name(fh->map_mode));
if (fh->map_mode == ZORAN_MAP_MODE_RAW) { if (fh->map_mode == ZORAN_MAP_MODE_RAW) {
if (fh->buffers.active != ZORAN_FREE) { if (fh->buffers.active != ZORAN_FREE) {
...@@ -2446,10 +2440,8 @@ static int zoran_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -2446,10 +2440,8 @@ static int zoran_mmap(struct file *file, struct vm_area_struct *vma)
struct zoran_mapping *map; struct zoran_mapping *map;
int res = 0; int res = 0;
dprintk(3, pci_info(zr->pci_dev, "%s(%s) of 0x%08lx-0x%08lx (size=%lu)\n", __func__,
KERN_INFO "%s: %s(%s) of 0x%08lx-0x%08lx (size=%lu)\n", mode_name(fh->map_mode), vma->vm_start, vma->vm_end, size);
ZR_DEVNAME(zr), __func__,
mode_name(fh->map_mode), vma->vm_start, vma->vm_end, size);
if (!(vma->vm_flags & VM_SHARED) || !(vma->vm_flags & VM_READ) || if (!(vma->vm_flags & VM_SHARED) || !(vma->vm_flags & VM_READ) ||
!(vma->vm_flags & VM_WRITE)) { !(vma->vm_flags & VM_WRITE)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment