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

media: zoran: convert all error dprintk to pci_err/pr_err

This patch converts all errors dprintk to pci_err/pr_err.
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 c6389136
...@@ -62,7 +62,7 @@ struct videocodec *videocodec_attach(struct videocodec_master *master) ...@@ -62,7 +62,7 @@ struct videocodec *videocodec_attach(struct videocodec_master *master)
int res; int res;
if (!master) { if (!master) {
dprintk(1, KERN_ERR "videocodec_attach: no data\n"); pr_err("%s: no data\n", __func__);
return NULL; return NULL;
} }
...@@ -70,9 +70,7 @@ struct videocodec *videocodec_attach(struct videocodec_master *master) ...@@ -70,9 +70,7 @@ struct videocodec *videocodec_attach(struct videocodec_master *master)
master->name, master->flags, master->magic); master->name, master->flags, master->magic);
if (!h) { if (!h) {
dprintk(1, pr_err("%s: no device available\n", __func__);
KERN_ERR
"videocodec_attach: no device available\n");
return NULL; return NULL;
} }
...@@ -120,7 +118,7 @@ struct videocodec *videocodec_attach(struct videocodec_master *master) ...@@ -120,7 +118,7 @@ struct videocodec *videocodec_attach(struct videocodec_master *master)
h = h->next; h = h->next;
} }
dprintk(1, KERN_ERR "videocodec_attach: no codec found!\n"); pr_err("%s: no codec found!\n", __func__);
return NULL; return NULL;
out_module_put: out_module_put:
...@@ -138,7 +136,7 @@ int videocodec_detach(struct videocodec *codec) ...@@ -138,7 +136,7 @@ int videocodec_detach(struct videocodec *codec)
int res; int res;
if (!codec) { if (!codec) {
dprintk(1, KERN_ERR "videocodec_detach: no data\n"); pr_err("%s: no data\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -146,8 +144,7 @@ int videocodec_detach(struct videocodec *codec) ...@@ -146,8 +144,7 @@ int videocodec_detach(struct videocodec *codec)
codec->name, codec->type, codec->flags, codec->magic); codec->name, codec->type, codec->flags, codec->magic);
if (!h) { if (!h) {
dprintk(1, pr_err("%s: no device left...\n", __func__);
KERN_ERR "videocodec_detach: no device left...\n");
return -ENXIO; return -ENXIO;
} }
...@@ -161,10 +158,7 @@ int videocodec_detach(struct videocodec *codec) ...@@ -161,10 +158,7 @@ int videocodec_detach(struct videocodec *codec)
dprintk(3, "%s: '%s'\n", __func__, a->codec->name); dprintk(3, "%s: '%s'\n", __func__, a->codec->name);
a->codec->master_data = NULL; a->codec->master_data = NULL;
} else { } else {
dprintk(1, pr_err("%s: '%s'\n", __func__, a->codec->name);
KERN_ERR
"videocodec_detach: '%s'\n",
a->codec->name);
a->codec->master_data = NULL; a->codec->master_data = NULL;
} }
if (!prev) { if (!prev) {
...@@ -186,7 +180,7 @@ int videocodec_detach(struct videocodec *codec) ...@@ -186,7 +180,7 @@ int videocodec_detach(struct videocodec *codec)
h = h->next; h = h->next;
} }
dprintk(1, KERN_ERR "videocodec_detach: given codec not found!\n"); pr_err("%s: given codec not found!\n", __func__);
return -EINVAL; return -EINVAL;
} }
EXPORT_SYMBOL(videocodec_detach); EXPORT_SYMBOL(videocodec_detach);
...@@ -196,7 +190,7 @@ int videocodec_register(const struct videocodec *codec) ...@@ -196,7 +190,7 @@ int videocodec_register(const struct videocodec *codec)
struct codec_list *ptr, *h = codeclist_top; struct codec_list *ptr, *h = codeclist_top;
if (!codec) { if (!codec) {
dprintk(1, KERN_ERR "videocodec_register: no data!\n"); pr_err("%s: no data!\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -229,7 +223,7 @@ int videocodec_unregister(const struct videocodec *codec) ...@@ -229,7 +223,7 @@ int videocodec_unregister(const struct videocodec *codec)
struct codec_list *prev = NULL, *h = codeclist_top; struct codec_list *prev = NULL, *h = codeclist_top;
if (!codec) { if (!codec) {
dprintk(1, KERN_ERR "videocodec_unregister: no data!\n"); pr_err("%s: no data!\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -238,19 +232,14 @@ int videocodec_unregister(const struct videocodec *codec) ...@@ -238,19 +232,14 @@ int videocodec_unregister(const struct videocodec *codec)
codec->name, codec->type, codec->flags, codec->magic); codec->name, codec->type, codec->flags, codec->magic);
if (!h) { if (!h) {
dprintk(1, pr_err("%s: no device left...\n", __func__);
KERN_ERR
"videocodec_unregister: no device left...\n");
return -ENXIO; return -ENXIO;
} }
while (h) { while (h) {
if (codec == h->codec) { if (codec == h->codec) {
if (h->attached) { if (h->attached) {
dprintk(1, pr_err("videocodec: '%s' is used\n", h->codec->name);
KERN_ERR
"videocodec: '%s' is used\n",
h->codec->name);
return -EBUSY; return -EBUSY;
} }
dprintk(3, "videocodec: unregister '%s' is ok.\n", dprintk(3, "videocodec: unregister '%s' is ok.\n",
...@@ -271,9 +260,7 @@ int videocodec_unregister(const struct videocodec *codec) ...@@ -271,9 +260,7 @@ int videocodec_unregister(const struct videocodec *codec)
h = h->next; h = h->next;
} }
dprintk(1, pr_err("%s: given codec not found!\n", __func__);
KERN_ERR
"videocodec_unregister: given codec not found!\n");
return -EINVAL; return -EINVAL;
} }
EXPORT_SYMBOL(videocodec_unregister); EXPORT_SYMBOL(videocodec_unregister);
...@@ -322,7 +309,7 @@ static int __init videocodec_init(void) ...@@ -322,7 +309,7 @@ static int __init videocodec_init(void)
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
videocodec_proc_entry = proc_create_single("videocodecs", 0, NULL, proc_videocodecs_show); videocodec_proc_entry = proc_create_single("videocodecs", 0, NULL, proc_videocodecs_show);
if (!videocodec_proc_entry) if (!videocodec_proc_entry)
dprintk(1, KERN_ERR "videocodec: can't init procfs.\n"); pr_err("videocodec: can't init procfs.\n");
#endif #endif
return 0; return 0;
} }
......
...@@ -787,18 +787,13 @@ int zoran_check_jpg_settings(struct zoran *zr, ...@@ -787,18 +787,13 @@ int zoran_check_jpg_settings(struct zoran *zr,
} }
if (!try && err0) { if (!try && err0) {
dprintk(1, pci_err(zr->pci_dev, "%s - error in params for decimation = 0\n", __func__);
KERN_ERR
"%s: %s - error in params for decimation = 0\n",
ZR_DEVNAME(zr), __func__);
err++; err++;
} }
break; break;
default: default:
dprintk(1, pci_err(zr->pci_dev, "%s - decimation = %d, must be 0, 1, 2 or 4\n",
KERN_ERR __func__, settings->decimation);
"%s: %s - decimation = %d, must be 0, 1, 2 or 4\n",
ZR_DEVNAME(zr), __func__, settings->decimation);
err++; err++;
break; break;
} }
...@@ -875,8 +870,7 @@ void zoran_open_init_params(struct zoran *zr) ...@@ -875,8 +870,7 @@ void zoran_open_init_params(struct zoran *zr)
V4L2_JPEG_MARKER_DHT | V4L2_JPEG_MARKER_DQT; V4L2_JPEG_MARKER_DHT | V4L2_JPEG_MARKER_DQT;
i = zoran_check_jpg_settings(zr, &zr->jpg_settings, 0); i = zoran_check_jpg_settings(zr, &zr->jpg_settings, 0);
if (i) if (i)
dprintk(1, KERN_ERR "%s: %s internal error\n", pci_err(zr->pci_dev, "%s internal error\n", __func__);
ZR_DEVNAME(zr), __func__);
clear_interrupt_counters(zr); clear_interrupt_counters(zr);
zr->testing = 0; zr->testing = 0;
...@@ -968,10 +962,6 @@ static int zr36057_init(struct zoran *zr) ...@@ -968,10 +962,6 @@ static int zr36057_init(struct zoran *zr)
zr->stat_com = kzalloc(BUZ_NUM_STAT_COM * 4, GFP_KERNEL); zr->stat_com = kzalloc(BUZ_NUM_STAT_COM * 4, GFP_KERNEL);
zr->video_dev = video_device_alloc(); zr->video_dev = video_device_alloc();
if (!zr->stat_com || !zr->video_dev) { if (!zr->stat_com || !zr->video_dev) {
dprintk(1,
KERN_ERR
"%s: %s - kmalloc (STAT_COM) failed\n",
ZR_DEVNAME(zr), __func__);
err = -ENOMEM; err = -ENOMEM;
goto exit_free; goto exit_free;
} }
...@@ -1132,8 +1122,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1132,8 +1122,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
nr = zoran_num++; nr = zoran_num++;
if (nr >= BUZ_MAX) { if (nr >= BUZ_MAX) {
dprintk(1, KERN_ERR "%s: driver limited to %d card(s) maximum\n", pci_err(pdev, "driver limited to %d card(s) maximum\n", BUZ_MAX);
ZORAN_NAME, BUZ_MAX);
return -ENOENT; return -ENOENT;
} }
...@@ -1172,23 +1161,14 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1172,23 +1161,14 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Use auto-detected card type? */ /* Use auto-detected card type? */
if (card[nr] == -1) { if (card[nr] == -1) {
if (zr->revision < 2) { if (zr->revision < 2) {
dprintk(1, pci_err(pdev, "No card type specified, please use the card=X module parameter\n");
KERN_ERR pci_err(pdev, "It is not possible to auto-detect ZR36057 based cards\n");
"%s: No card type specified, please use the card=X module parameter\n",
ZR_DEVNAME(zr));
dprintk(1,
KERN_ERR
"%s: It is not possible to auto-detect ZR36057 based cards\n",
ZR_DEVNAME(zr));
goto zr_unreg; goto zr_unreg;
} }
card_num = ent->driver_data; card_num = ent->driver_data;
if (card_num >= NUM_CARDS) { if (card_num >= NUM_CARDS) {
dprintk(1, pci_err(pdev, "Unknown card, try specifying card=X module parameter\n");
KERN_ERR
"%s: Unknown card, try specifying card=X module parameter\n",
ZR_DEVNAME(zr));
goto zr_unreg; goto zr_unreg;
} }
dprintk(3, dprintk(3,
...@@ -1198,10 +1178,8 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1198,10 +1178,8 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} else { } else {
card_num = card[nr]; card_num = card[nr];
if (card_num >= NUM_CARDS || card_num < 0) { if (card_num >= NUM_CARDS || card_num < 0) {
dprintk(1, pci_err(pdev, "User specified card type %d out of range (0 .. %d)\n",
KERN_ERR card_num, NUM_CARDS - 1);
"%s: User specified card type %d out of range (0 .. %d)\n",
ZR_DEVNAME(zr), card_num, NUM_CARDS - 1);
goto zr_unreg; goto zr_unreg;
} }
} }
...@@ -1219,8 +1197,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1219,8 +1197,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
zr->zr36057_mem = pci_ioremap_bar(zr->pci_dev, 0); zr->zr36057_mem = pci_ioremap_bar(zr->pci_dev, 0);
if (!zr->zr36057_mem) { if (!zr->zr36057_mem) {
dprintk(1, KERN_ERR "%s: %s() - ioremap failed\n", pci_err(pdev, "%s() - ioremap failed\n", __func__);
ZR_DEVNAME(zr), __func__);
goto zr_unreg; goto zr_unreg;
} }
...@@ -1228,20 +1205,12 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1228,20 +1205,12 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
IRQF_SHARED, ZR_DEVNAME(zr), zr); IRQF_SHARED, ZR_DEVNAME(zr), zr);
if (result < 0) { if (result < 0) {
if (result == -EINVAL) { if (result == -EINVAL) {
dprintk(1, pci_err(pdev, "%s - bad IRQ number or handler\n", __func__);
KERN_ERR
"%s: %s - bad irq number or handler\n",
ZR_DEVNAME(zr), __func__);
} else if (result == -EBUSY) { } else if (result == -EBUSY) {
dprintk(1, pci_err(pdev, "%s - IRQ %d busy, change your PnP config in BIOS\n",
KERN_ERR __func__, zr->pci_dev->irq);
"%s: %s - IRQ %d busy, change your PnP config in BIOS\n",
ZR_DEVNAME(zr), __func__, zr->pci_dev->irq);
} else { } else {
dprintk(1, pci_err(pdev, "%s - cannot assign IRQ, error code %d\n", __func__, result);
KERN_ERR
"%s: %s - can't assign irq, error code %d\n",
ZR_DEVNAME(zr), __func__, result);
} }
goto zr_unmap; goto zr_unmap;
} }
...@@ -1261,8 +1230,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1261,8 +1230,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dprintk(2, KERN_INFO "%s: Initializing i2c bus...\n", ZR_DEVNAME(zr)); dprintk(2, KERN_INFO "%s: Initializing i2c bus...\n", ZR_DEVNAME(zr));
if (zoran_register_i2c(zr) < 0) { if (zoran_register_i2c(zr) < 0) {
dprintk(1, KERN_ERR "%s: %s - can't initialize i2c bus\n", pci_err(pdev, "%s - can't initialize i2c bus\n", __func__);
ZR_DEVNAME(zr), __func__);
goto zr_free_irq; goto zr_free_irq;
} }
...@@ -1281,24 +1249,16 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1281,24 +1249,16 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
codec_name = codecid_to_modulename(zr->card.video_codec); codec_name = codecid_to_modulename(zr->card.video_codec);
if (codec_name) { if (codec_name) {
result = request_module(codec_name); result = request_module(codec_name);
if (result) { if (result)
dprintk(1, pci_err(pdev, "failed to load modules %s: %d\n", codec_name, result);
KERN_ERR
"%s: failed to load modules %s: %d\n",
ZR_DEVNAME(zr), codec_name, result);
}
} }
} }
if (zr->card.video_vfe) { if (zr->card.video_vfe) {
vfe_name = codecid_to_modulename(zr->card.video_vfe); vfe_name = codecid_to_modulename(zr->card.video_vfe);
if (vfe_name) { if (vfe_name) {
result = request_module(vfe_name); result = request_module(vfe_name);
if (result < 0) { if (result < 0)
dprintk(1, pci_err(pdev, "failed to load modules %s: %d\n", vfe_name, result);
KERN_ERR
"%s: failed to load modules %s: %d\n",
ZR_DEVNAME(zr), vfe_name, result);
}
} }
} }
...@@ -1313,13 +1273,11 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1313,13 +1273,11 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto zr_unreg_i2c; goto zr_unreg_i2c;
zr->codec = videocodec_attach(master_codec); zr->codec = videocodec_attach(master_codec);
if (!zr->codec) { if (!zr->codec) {
dprintk(1, KERN_ERR "%s: %s - no codec found\n", pci_err(pdev, "%s - no codec found\n", __func__);
ZR_DEVNAME(zr), __func__);
goto zr_free_codec; goto zr_free_codec;
} }
if (zr->codec->type != zr->card.video_codec) { if (zr->codec->type != zr->card.video_codec) {
dprintk(1, KERN_ERR "%s: %s - wrong codec\n", pci_err(pdev, "%s - wrong codec\n", __func__);
ZR_DEVNAME(zr), __func__);
goto zr_detach_codec; goto zr_detach_codec;
} }
} }
...@@ -1329,13 +1287,11 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1329,13 +1287,11 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto zr_detach_codec; goto zr_detach_codec;
zr->vfe = videocodec_attach(master_vfe); zr->vfe = videocodec_attach(master_vfe);
if (!zr->vfe) { if (!zr->vfe) {
dprintk(1, KERN_ERR "%s: %s - no VFE found\n", pci_err(pdev, "%s - no VFE found\n", __func__);
ZR_DEVNAME(zr), __func__);
goto zr_free_vfe; goto zr_free_vfe;
} }
if (zr->vfe->type != zr->card.video_vfe) { if (zr->vfe->type != zr->card.video_vfe) {
dprintk(1, KERN_ERR "%s: %s = wrong VFE\n", pci_err(pdev, "%s = wrong VFE\n", __func__);
ZR_DEVNAME(zr), __func__);
goto zr_detach_vfe; goto zr_detach_vfe;
} }
} }
...@@ -1430,9 +1386,7 @@ static int __init zoran_init(void) ...@@ -1430,9 +1386,7 @@ static int __init zoran_init(void)
res = pci_register_driver(&zoran_driver); res = pci_register_driver(&zoran_driver);
if (res) { if (res) {
dprintk(1, pr_err("Unable to register ZR36057 driver\n");
KERN_ERR
"%s: Unable to register ZR36057 driver\n", ZORAN_NAME);
return res; return res;
} }
......
...@@ -315,8 +315,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height, ...@@ -315,8 +315,7 @@ static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
if (video_width < BUZ_MIN_WIDTH || if (video_width < BUZ_MIN_WIDTH ||
video_height < BUZ_MIN_HEIGHT || video_height < BUZ_MIN_HEIGHT ||
video_width > Wa || video_height > Ha) { video_width > Wa || video_height > Ha) {
dprintk(1, KERN_ERR "%s: set_vfe: w=%d h=%d not valid\n", pci_err(zr->pci_dev, "set_vfe: w=%d h=%d not valid\n", video_width, video_height);
ZR_DEVNAME(zr), video_width, video_height);
return; return;
} }
...@@ -451,10 +450,7 @@ void zr36057_overlay(struct zoran *zr, int on) ...@@ -451,10 +450,7 @@ void zr36057_overlay(struct zoran *zr, int on)
zr->vbuf_bytesperline; zr->vbuf_bytesperline;
btwrite(reg, ZR36057_VDTR); btwrite(reg, ZR36057_VDTR);
if (reg & 3) if (reg & 3)
dprintk(1, pci_err(zr->pci_dev, "zr36057_overlay() - video_address not aligned\n");
KERN_ERR
"%s: zr36057_overlay() - video_address not aligned\n",
ZR_DEVNAME(zr));
if (zr->overlay_settings.height > BUZ_MAX_HEIGHT / 2) if (zr->overlay_settings.height > BUZ_MAX_HEIGHT / 2)
reg += zr->vbuf_bytesperline; reg += zr->vbuf_bytesperline;
btwrite(reg, ZR36057_VDBR); btwrite(reg, ZR36057_VDBR);
...@@ -466,10 +462,7 @@ void zr36057_overlay(struct zoran *zr, int on) ...@@ -466,10 +462,7 @@ void zr36057_overlay(struct zoran *zr, int on)
if (zr->overlay_settings.height > BUZ_MAX_HEIGHT / 2) if (zr->overlay_settings.height > BUZ_MAX_HEIGHT / 2)
reg += zr->vbuf_bytesperline; reg += zr->vbuf_bytesperline;
if (reg & 3) if (reg & 3)
dprintk(1, pci_err(zr->pci_dev, "zr36057_overlay() - video_stride not aligned\n");
KERN_ERR
"%s: zr36057_overlay() - video_stride not aligned\n",
ZR_DEVNAME(zr));
reg = (reg << ZR36057_VSSFGR_DispStride); reg = (reg << ZR36057_VSSFGR_DispStride);
reg |= ZR36057_VSSFGR_VidOvf; /* clear overflow status */ reg |= ZR36057_VSSFGR_VidOvf; /* clear overflow status */
btwrite(reg, ZR36057_VSSFGR); btwrite(reg, ZR36057_VSSFGR);
...@@ -1203,8 +1196,8 @@ static void error_handler(struct zoran *zr, u32 astat, u32 stat) ...@@ -1203,8 +1196,8 @@ static void error_handler(struct zoran *zr, u32 astat, u32 stat)
int j; int j;
frame = zr->jpg_pend[zr->jpg_dma_tail & BUZ_MASK_FRAME]; frame = zr->jpg_pend[zr->jpg_dma_tail & BUZ_MASK_FRAME];
pr_err("%s: JPEG error stat=0x%08x(0x%08x) queue_state=%ld/%ld/%ld/%ld seq=%ld frame=%ld. Codec stopped. ", pci_err(zr->pci_dev, "JPEG error stat=0x%08x(0x%08x) queue_state=%ld/%ld/%ld/%ld seq=%ld frame=%ld. Codec stopped. ",
ZR_DEVNAME(zr), stat, zr->last_isr, stat, zr->last_isr,
zr->jpg_que_tail, zr->jpg_dma_tail, zr->jpg_que_tail, zr->jpg_dma_tail,
zr->jpg_dma_head, zr->jpg_que_head, zr->jpg_dma_head, zr->jpg_que_head,
zr->jpg_seq_num, frame); zr->jpg_seq_num, frame);
...@@ -1272,10 +1265,8 @@ irqreturn_t zoran_irq(int irq, void *dev_id) ...@@ -1272,10 +1265,8 @@ irqreturn_t zoran_irq(int irq, void *dev_id)
while ((stat = count_reset_interrupt(zr))) { while ((stat = count_reset_interrupt(zr))) {
if (count++ > 100) { if (count++ > 100) {
btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR); btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR);
dprintk(1, pci_err(zr->pci_dev, "IRQ lockup while testing, isr=0x%08x, cleared int mask\n",
KERN_ERR stat);
"%s: IRQ lockup while testing, isr=0x%08x, cleared int mask\n",
ZR_DEVNAME(zr), stat);
wake_up_interruptible(&zr->test_q); wake_up_interruptible(&zr->test_q);
} }
} }
...@@ -1435,10 +1426,7 @@ irqreturn_t zoran_irq(int irq, void *dev_id) ...@@ -1435,10 +1426,7 @@ irqreturn_t zoran_irq(int irq, void *dev_id)
ZR_DEVNAME(zr), count); ZR_DEVNAME(zr), count);
if (count > 20) { if (count > 20) {
btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR); btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR);
dprintk(2, pci_err(zr->pci_dev, "IRQ lockup, cleared int mask\n");
KERN_ERR
"%s: IRQ lockup, cleared int mask\n",
ZR_DEVNAME(zr));
break; break;
} }
} }
......
This diff is collapsed.
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/printk.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
...@@ -192,8 +193,7 @@ int zoran_proc_init(struct zoran *zr) ...@@ -192,8 +193,7 @@ int zoran_proc_init(struct zoran *zr)
"%s: procfs entry /proc/%s allocated. data=%p\n", "%s: procfs entry /proc/%s allocated. data=%p\n",
ZR_DEVNAME(zr), name, zr); ZR_DEVNAME(zr), name, zr);
} else { } else {
dprintk(1, KERN_ERR "%s: Unable to initialise /proc/%s\n", pr_err("%s: Unable to initialise /proc/%s\n", ZR_DEVNAME(zr), name);
ZR_DEVNAME(zr), name);
return 1; return 1;
} }
#endif #endif
......
...@@ -48,9 +48,7 @@ static u8 zr36016_read(struct zr36016 *ptr, u16 reg) ...@@ -48,9 +48,7 @@ static u8 zr36016_read(struct zr36016 *ptr, u16 reg)
if (ptr->codec->master_data->readreg) if (ptr->codec->master_data->readreg)
value = (ptr->codec->master_data->readreg(ptr->codec, reg)) & 0xFF; value = (ptr->codec->master_data->readreg(ptr->codec, reg)) & 0xFF;
else else
dprintk(1, pr_err("%s: invalid I/O setup, nothing read!\n", ptr->name);
KERN_ERR "%s: invalid I/O setup, nothing read!\n",
ptr->name);
dprintk(4, "%s: reading from 0x%04x: %02x\n", ptr->name, reg, value); dprintk(4, "%s: reading from 0x%04x: %02x\n", ptr->name, reg, value);
...@@ -65,10 +63,7 @@ static void zr36016_write(struct zr36016 *ptr, u16 reg, u8 value) ...@@ -65,10 +63,7 @@ static void zr36016_write(struct zr36016 *ptr, u16 reg, u8 value)
if (ptr->codec->master_data->writereg) if (ptr->codec->master_data->writereg)
ptr->codec->master_data->writereg(ptr->codec, reg, value); ptr->codec->master_data->writereg(ptr->codec, reg, value);
else else
dprintk(1, pr_err("%s: invalid I/O setup, nothing written!\n", ptr->name);
KERN_ERR
"%s: invalid I/O setup, nothing written!\n",
ptr->name);
} }
/* indirect read and write functions */ /* indirect read and write functions */
...@@ -83,10 +78,7 @@ static u8 zr36016_readi(struct zr36016 *ptr, u16 reg) ...@@ -83,10 +78,7 @@ static u8 zr36016_readi(struct zr36016 *ptr, u16 reg)
ptr->codec->master_data->writereg(ptr->codec, ZR016_IADDR, reg & 0x0F); // ADDR ptr->codec->master_data->writereg(ptr->codec, ZR016_IADDR, reg & 0x0F); // ADDR
value = (ptr->codec->master_data->readreg(ptr->codec, ZR016_IDATA)) & 0xFF; // DATA value = (ptr->codec->master_data->readreg(ptr->codec, ZR016_IDATA)) & 0xFF; // DATA
} else { } else {
dprintk(1, pr_err("%s: invalid I/O setup, nothing read (i)!\n", ptr->name);
KERN_ERR
"%s: invalid I/O setup, nothing read (i)!\n",
ptr->name);
} }
dprintk(4, "%s: reading indirect from 0x%04x: %02x\n", ptr->name, reg, value); dprintk(4, "%s: reading indirect from 0x%04x: %02x\n", ptr->name, reg, value);
...@@ -103,10 +95,7 @@ static void zr36016_writei(struct zr36016 *ptr, u16 reg, u8 value) ...@@ -103,10 +95,7 @@ static void zr36016_writei(struct zr36016 *ptr, u16 reg, u8 value)
ptr->codec->master_data->writereg(ptr->codec, ZR016_IADDR, reg & 0x0F); // ADDR ptr->codec->master_data->writereg(ptr->codec, ZR016_IADDR, reg & 0x0F); // ADDR
ptr->codec->master_data->writereg(ptr->codec, ZR016_IDATA, value & 0x0FF); // DATA ptr->codec->master_data->writereg(ptr->codec, ZR016_IDATA, value & 0x0FF); // DATA
} else { } else {
dprintk(1, pr_err("%s: invalid I/O setup, nothing written (i)!\n", ptr->name);
KERN_ERR
"%s: invalid I/O setup, nothing written (i)!\n",
ptr->name);
} }
} }
...@@ -144,27 +133,19 @@ static int zr36016_basic_test(struct zr36016 *ptr) ...@@ -144,27 +133,19 @@ static int zr36016_basic_test(struct zr36016 *ptr)
// it back in both cases // it back in both cases
zr36016_writei(ptr, ZR016I_PAX_LO, 0x00); zr36016_writei(ptr, ZR016I_PAX_LO, 0x00);
if (zr36016_readi(ptr, ZR016I_PAX_LO) != 0x0) { if (zr36016_readi(ptr, ZR016I_PAX_LO) != 0x0) {
dprintk(1, pr_err("%s: attach failed, can't connect to vfe processor!\n", ptr->name);
KERN_ERR
"%s: attach failed, can't connect to vfe processor!\n",
ptr->name);
return -ENXIO; return -ENXIO;
} }
zr36016_writei(ptr, ZR016I_PAX_LO, 0x0d0); zr36016_writei(ptr, ZR016I_PAX_LO, 0x0d0);
if (zr36016_readi(ptr, ZR016I_PAX_LO) != 0x0d0) { if (zr36016_readi(ptr, ZR016I_PAX_LO) != 0x0d0) {
dprintk(1, pr_err("%s: attach failed, can't connect to vfe processor!\n", ptr->name);
KERN_ERR
"%s: attach failed, can't connect to vfe processor!\n",
ptr->name);
return -ENXIO; return -ENXIO;
} }
// we allow version numbers from 0-3, should be enough, though // we allow version numbers from 0-3, should be enough, though
zr36016_read_version(ptr); zr36016_read_version(ptr);
if (ptr->version & 0x0c) { if (ptr->version & 0x0c) {
dprintk(1, pr_err("%s: attach failed, suspicious version %d found...\n", ptr->name,
KERN_ERR ptr->version);
"%s: attach failed, suspicious version %d found...\n",
ptr->name, ptr->version);
return -ENXIO; return -ENXIO;
} }
...@@ -376,12 +357,12 @@ static int zr36016_setup(struct videocodec *codec) ...@@ -376,12 +357,12 @@ static int zr36016_setup(struct videocodec *codec)
dprintk(2, "zr36016: initializing VFE subsystem #%d.\n", zr36016_codecs); dprintk(2, "zr36016: initializing VFE subsystem #%d.\n", zr36016_codecs);
if (zr36016_codecs == MAX_CODECS) { if (zr36016_codecs == MAX_CODECS) {
dprintk(1, KERN_ERR "zr36016: Can't attach more codecs!\n"); pr_err("zr36016: Can't attach more codecs!\n");
return -ENOSPC; return -ENOSPC;
} }
//mem structure init //mem structure init
codec->data = ptr = kzalloc(sizeof(struct zr36016), GFP_KERNEL); codec->data = ptr = kzalloc(sizeof(struct zr36016), GFP_KERNEL);
if (!ptr) { if (!ptr)
return -ENOMEM; return -ENOMEM;
snprintf(ptr->name, sizeof(ptr->name), "zr36016[%d]", zr36016_codecs); snprintf(ptr->name, sizeof(ptr->name), "zr36016[%d]", zr36016_codecs);
......
...@@ -448,8 +448,7 @@ static void zr36050_init(struct zr36050 *ptr) ...@@ -448,8 +448,7 @@ static void zr36050_init(struct zr36050 *ptr)
ptr->name, ptr->status1); ptr->name, ptr->status1);
if ((ptr->status1 & 0x4) == 0) { if ((ptr->status1 & 0x4) == 0) {
dprintk(1, KERN_ERR "%s: init aborted!\n", pr_err("%s: init aborted!\n", ptr->name);
ptr->name);
return; // something is wrong, its timed out!!!! return; // something is wrong, its timed out!!!!
} }
...@@ -518,8 +517,7 @@ static void zr36050_init(struct zr36050 *ptr) ...@@ -518,8 +517,7 @@ static void zr36050_init(struct zr36050 *ptr)
ptr->name, ptr->status1); ptr->name, ptr->status1);
if ((ptr->status1 & 0x4) == 0) { if ((ptr->status1 & 0x4) == 0) {
dprintk(1, KERN_ERR "%s: init aborted!\n", pr_err("%s: init aborted!\n", ptr->name);
ptr->name);
return; // something is wrong, its timed out!!!! return; // something is wrong, its timed out!!!!
} }
...@@ -757,10 +755,8 @@ static int zr36050_setup(struct videocodec *codec) ...@@ -757,10 +755,8 @@ static int zr36050_setup(struct videocodec *codec)
} }
//mem structure init //mem structure init
codec->data = ptr = kzalloc(sizeof(struct zr36050), GFP_KERNEL); codec->data = ptr = kzalloc(sizeof(struct zr36050), GFP_KERNEL);
if (!ptr) { if (!ptr)
dprintk(1, KERN_ERR "zr36050: Can't get enough memory!\n");
return -ENOMEM; return -ENOMEM;
}
snprintf(ptr->name, sizeof(ptr->name), "zr36050[%d]", snprintf(ptr->name, sizeof(ptr->name), "zr36050[%d]",
zr36050_codecs); zr36050_codecs);
......
...@@ -59,9 +59,7 @@ static u8 zr36060_read(struct zr36060 *ptr, u16 reg) ...@@ -59,9 +59,7 @@ static u8 zr36060_read(struct zr36060 *ptr, u16 reg)
if (ptr->codec->master_data->readreg) if (ptr->codec->master_data->readreg)
value = (ptr->codec->master_data->readreg(ptr->codec, reg)) & 0xff; value = (ptr->codec->master_data->readreg(ptr->codec, reg)) & 0xff;
else else
dprintk(1, pr_err("%s: invalid I/O setup, nothing read!\n", ptr->name);
KERN_ERR "%s: invalid I/O setup, nothing read!\n",
ptr->name);
return value; return value;
} }
...@@ -74,10 +72,7 @@ static void zr36060_write(struct zr36060 *ptr, u16 reg, u8 value) ...@@ -74,10 +72,7 @@ static void zr36060_write(struct zr36060 *ptr, u16 reg, u8 value)
if (ptr->codec->master_data->writereg) if (ptr->codec->master_data->writereg)
ptr->codec->master_data->writereg(ptr->codec, reg, value); ptr->codec->master_data->writereg(ptr->codec, reg, value);
else else
dprintk(1, pr_err("%s: invalid I/O setup, nothing written!\n", ptr->name);
KERN_ERR
"%s: invalid I/O setup, nothing written!\n",
ptr->name);
} }
/* ========================================================================= /* =========================================================================
...@@ -127,19 +122,13 @@ static int zr36060_basic_test(struct zr36060 *ptr) ...@@ -127,19 +122,13 @@ static int zr36060_basic_test(struct zr36060 *ptr)
{ {
if ((zr36060_read(ptr, ZR060_IDR_DEV) != 0x33) && if ((zr36060_read(ptr, ZR060_IDR_DEV) != 0x33) &&
(zr36060_read(ptr, ZR060_IDR_REV) != 0x01)) { (zr36060_read(ptr, ZR060_IDR_REV) != 0x01)) {
dprintk(1, pr_err("%s: attach failed, can't connect to jpeg processor!\n", ptr->name);
KERN_ERR
"%s: attach failed, can't connect to jpeg processor!\n",
ptr->name);
return -ENXIO; return -ENXIO;
} }
zr36060_wait_end(ptr); zr36060_wait_end(ptr);
if (ptr->status & ZR060_CFSR_Busy) { if (ptr->status & ZR060_CFSR_Busy) {
dprintk(1, pr_err("%s: attach failed, jpeg processor failed (end flag)!\n", ptr->name);
KERN_ERR
"%s: attach failed, jpeg processor failed (end flag)!\n",
ptr->name);
return -EBUSY; return -EBUSY;
} }
...@@ -458,7 +447,7 @@ static void zr36060_init(struct zr36060 *ptr) ...@@ -458,7 +447,7 @@ static void zr36060_init(struct zr36060 *ptr)
dprintk(2, "%s: Status after table preload: 0x%02x\n", ptr->name, ptr->status); dprintk(2, "%s: Status after table preload: 0x%02x\n", ptr->name, ptr->status);
if (ptr->status & ZR060_CFSR_Busy) { if (ptr->status & ZR060_CFSR_Busy) {
dprintk(1, KERN_ERR "%s: init aborted!\n", ptr->name); pr_err("%s: init aborted!\n", ptr->name);
return; // something is wrong, its timed out!!!! return; // something is wrong, its timed out!!!!
} }
} }
...@@ -797,8 +786,7 @@ static int zr36060_setup(struct videocodec *codec) ...@@ -797,8 +786,7 @@ static int zr36060_setup(struct videocodec *codec)
dprintk(2, "zr36060: initializing MJPEG subsystem #%d.\n", zr36060_codecs); dprintk(2, "zr36060: initializing MJPEG subsystem #%d.\n", zr36060_codecs);
if (zr36060_codecs == MAX_CODECS) { if (zr36060_codecs == MAX_CODECS) {
dprintk(1, pr_err("zr36060: Can't attach more codecs!\n");
KERN_ERR "zr36060: Can't attach more codecs!\n");
return -ENOSPC; return -ENOSPC;
} }
//mem structure init //mem structure init
......
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