Commit 65bc2fe8 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Mauro Carvalho Chehab

[media] cx88: convert it to use pr_foo() macros

Instead of calling printk() directly, use pr_foo()
macros, as suggested at the Kernel's coding style.

Please notice that a conversion to dev_foo() is not trivial,
as several parts on this driver uses pr_cont().
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 3b0cb24f
......@@ -24,6 +24,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "cx88.h"
#include "cx88-reg.h"
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
......@@ -42,18 +45,11 @@
#include <sound/tlv.h>
#include <media/i2c/wm8775.h>
#include "cx88.h"
#include "cx88-reg.h"
#define dprintk(level, fmt, arg...) do { \
if (debug + 1 > level) \
printk(KERN_INFO "%s/1: " fmt, chip->core->name , ## arg);\
} while(0)
#define dprintk_core(level, fmt, arg...) do { \
if (debug + 1 > level) \
printk(KERN_DEBUG "%s/1: " fmt, chip->core->name , ## arg);\
} while(0)
printk(KERN_DEBUG pr_fmt("%s: alsa: " fmt), \
chip->core->name, ##arg); \
} while (0)
/****************************************************************************
Data type declarations - Can be moded to a header file later
......@@ -230,12 +226,12 @@ static void cx8801_aud_irq(snd_cx88_card_t *chip)
return;
cx_write(MO_AUD_INTSTAT, status);
if (debug > 1 || (status & mask & ~0xff))
cx88_print_irqbits(core->name, "irq aud",
cx88_print_irqbits("irq aud",
cx88_aud_irqs, ARRAY_SIZE(cx88_aud_irqs),
status, mask);
/* risc op code error */
if (status & AUD_INT_OPC_ERR) {
printk(KERN_WARNING "%s/1: Audio risc op code error\n",core->name);
pr_warn("Audio risc op code error\n");
cx_clear(MO_AUD_DMACNTRL, 0x11);
cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH25]);
}
......@@ -279,9 +275,7 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id)
}
if (MAX_IRQ_LOOP == loop) {
printk(KERN_ERR
"%s/1: IRQ loop detected, disabling interrupts\n",
core->name);
pr_err("IRQ loop detected, disabling interrupts\n");
cx_clear(MO_PCI_INTMSK, PCI_INT_AUDINT);
}
......@@ -423,7 +417,7 @@ static int snd_cx88_pcm_open(struct snd_pcm_substream *substream)
int err;
if (!chip) {
printk(KERN_ERR "BUG: cx88 can't find device struct. Can't proceed with open\n");
pr_err("BUG: cx88 can't find device struct. Can't proceed with open\n");
return -ENODEV;
}
......
......@@ -26,6 +26,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "cx88.h"
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
......@@ -38,8 +40,6 @@
#include <media/v4l2-event.h>
#include <media/drv-intf/cx2341x.h>
#include "cx88.h"
MODULE_DESCRIPTION("driver for cx2388x/cx23416 based mpeg encoder cards");
MODULE_AUTHOR("Jelle Foks <jelle@foks.us>, Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
MODULE_LICENSE("GPL");
......@@ -51,8 +51,9 @@ MODULE_PARM_DESC(debug,"enable debug messages [blackbird]");
#define dprintk(level, fmt, arg...) do { \
if (debug + 1 > level) \
printk(KERN_DEBUG "%s/2-bb: " fmt, dev->core->name , ## arg); \
} while(0)
printk(KERN_DEBUG pr_fmt("%s: blackbird:" fmt), \
__func__, ##arg); \
} while (0)
/* ------------------------------------------------------------------ */
......@@ -1118,12 +1119,11 @@ static int blackbird_register_video(struct cx8802_dev *dev)
dev->mpeg_dev.queue = &dev->vb2_mpegq;
err = video_register_device(&dev->mpeg_dev, VFL_TYPE_GRABBER, -1);
if (err < 0) {
printk(KERN_INFO "%s/2: can't register mpeg device\n",
dev->core->name);
pr_info("can't register mpeg device\n");
return err;
}
printk(KERN_INFO "%s/2: registered device %s [mpeg]\n",
dev->core->name, video_device_node_name(&dev->mpeg_dev));
pr_info("registered device %s [mpeg]\n",
video_device_node_name(&dev->mpeg_dev));
return 0;
}
......@@ -1158,8 +1158,7 @@ static int cx8802_blackbird_probe(struct cx8802_driver *drv)
v4l2_ctrl_add_handler(&dev->cxhdl.hdl, &core->video_hdl, NULL);
/* blackbird stuff */
printk("%s/2: cx23416 based mpeg encoder (blackbird reference design)\n",
core->name);
pr_info("cx23416 based mpeg encoder (blackbird reference design)\n");
host_setup(dev->core);
blackbird_initialize_codec(dev);
......@@ -1219,7 +1218,7 @@ static struct cx8802_driver cx8802_blackbird_driver = {
static int __init blackbird_init(void)
{
printk(KERN_INFO "cx2388x blackbird driver version %s loaded\n",
pr_info("cx2388x blackbird driver version %s loaded\n",
CX88_VERSION);
return cx8802_register_driver(&cx8802_blackbird_driver);
}
......
......@@ -20,16 +20,16 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "cx88.h"
#include "tea5767.h"
#include "xc4000.h"
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include "cx88.h"
#include "tea5767.h"
#include "xc4000.h"
static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
......@@ -50,19 +50,11 @@ static int disable_ir;
module_param(disable_ir, int, 0444);
MODULE_PARM_DESC(disable_ir, "Disable IR support");
#define info_printk(core, fmt, arg...) \
printk(KERN_INFO "%s: " fmt, core->name , ## arg)
#define warn_printk(core, fmt, arg...) \
printk(KERN_WARNING "%s: " fmt, core->name , ## arg)
#define err_printk(core, fmt, arg...) \
printk(KERN_ERR "%s: " fmt, core->name , ## arg)
#define dprintk(level,fmt, arg...) do { \
if (cx88_core_debug >= level) \
printk(KERN_DEBUG "%s: " fmt, core->name , ## arg); \
} while(0)
printk(KERN_DEBUG pr_fmt("%s: core:" fmt), \
__func__, ##arg); \
} while (0)
/* ------------------------------------------------------------------ */
......@@ -2829,7 +2821,7 @@ static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
if (eeprom_data[4] != 0x7d ||
eeprom_data[5] != 0x10 ||
eeprom_data[7] != 0x66) {
warn_printk(core, "Leadtek eeprom invalid.\n");
pr_warn("Leadtek eeprom invalid.\n");
return;
}
......@@ -2847,7 +2839,7 @@ static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
break;
}
info_printk(core, "Leadtek Winfast 2000XP Expert config: tuner=%d, eeprom[0]=0x%02x\n",
pr_info("Leadtek Winfast 2000XP Expert config: tuner=%d, eeprom[0]=0x%02x\n",
core->board.tuner_type, eeprom_data[0]);
}
......@@ -2904,12 +2896,11 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
cx_set(MO_GP0_IO, 0x008989FF);
break;
default:
warn_printk(core, "warning: unknown hauppauge model #%d\n",
tv.model);
pr_warn("warning: unknown hauppauge model #%d\n", tv.model);
break;
}
info_printk(core, "hauppauge eeprom: model=%d\n", tv.model);
pr_info("hauppauge eeprom: model=%d\n", tv.model);
}
/* ----------------------------------------------------------------------- */
......@@ -2955,7 +2946,7 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
const char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
? gdi_tuner[eeprom_data[0x0d]].name : NULL;
info_printk(core, "GDI: tuner=%s\n", name ? name : "unknown");
pr_info("GDI: tuner=%s\n", name ? name : "unknown");
if (NULL == name)
return;
core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
......@@ -3106,7 +3097,7 @@ static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core)
msg.len = (i != 12 ? 5 : 2);
err = i2c_transfer(&core->i2c_adap, &msg, 1);
if (err != 1) {
warn_printk(core, "dvico_fusionhdtv_hybrid_init buf %d failed (err = %d)!\n",
pr_warn("dvico_fusionhdtv_hybrid_init buf %d failed (err = %d)!\n",
i, err);
return;
}
......@@ -3229,14 +3220,14 @@ int cx88_tuner_callback(void *priv, int component, int command, int arg)
struct cx88_core *core;
if (!i2c_algo) {
printk(KERN_ERR "cx88: Error - i2c private data undefined.\n");
pr_err("Error - i2c private data undefined.\n");
return -EINVAL;
}
core = i2c_algo->data;
if (!core) {
printk(KERN_ERR "cx88: Error - device struct undefined.\n");
pr_err("Error - device struct undefined.\n");
return -EINVAL;
}
......@@ -3254,7 +3245,7 @@ int cx88_tuner_callback(void *priv, int component, int command, int arg)
dprintk(1, "Calling XC5000 callback\n");
return cx88_xc5000_tuner_callback(core, command, arg);
}
err_printk(core, "Error: Calling callback for tuner %d\n",
pr_err("Error: Calling callback for tuner %d\n",
core->board.tuner_type);
return -EINVAL;
}
......@@ -3268,25 +3259,19 @@ static void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
if (0 == pci->subsystem_vendor &&
0 == pci->subsystem_device) {
printk(KERN_ERR
"%s: Your board has no valid PCI Subsystem ID and thus can't\n"
"%s: be autodetected. Please pass card=<n> insmod option to\n"
"%s: workaround that. Redirect complaints to the vendor of\n"
"%s: the TV card. Best regards,\n"
"%s: -- tux\n",
core->name,core->name,core->name,core->name,core->name);
pr_err("Your board has no valid PCI Subsystem ID and thus can't\n");
pr_err("be autodetected. Please pass card=<n> insmod option to\n");
pr_err("workaround that. Redirect complaints to the vendor of\n");
pr_err("the TV card\n");
} else {
printk(KERN_ERR
"%s: Your board isn't known (yet) to the driver. You can\n"
"%s: try to pick one of the existing card configs via\n"
"%s: card=<n> insmod option. Updating to the latest\n"
"%s: version might help as well.\n",
core->name,core->name,core->name,core->name);
pr_err("Your board isn't known (yet) to the driver. You can\n");
pr_err("try to pick one of the existing card configs via\n");
pr_err("card=<n> insmod option. Updating to the latest\n");
pr_err("version might help as well.\n");
}
err_printk(core, "Here is a list of valid choices for the card=<n> insmod option:\n");
pr_err("Here is a list of valid choices for the card=<n> insmod option:\n");
for (i = 0; i < ARRAY_SIZE(cx88_boards); i++)
printk(KERN_ERR "%s: card=%d -> %s\n",
core->name, i, cx88_boards[i].name);
pr_err(" card=%d -> %s\n", i, cx88_boards[i].name);
}
static void cx88_card_setup_pre_i2c(struct cx88_core *core)
......@@ -3508,7 +3493,7 @@ static void cx88_card_setup(struct cx88_core *core)
for (i = 0; i < ARRAY_SIZE(buffer); i++)
if (2 != i2c_master_send(&core->i2c_client,
buffer[i],2))
warn_printk(core, "Unable to enable tuner(%i).\n",
pr_warn("Unable to enable tuner(%i).\n",
i);
}
break;
......@@ -3608,29 +3593,24 @@ static int cx88_pci_quirks(const char *name, struct pci_dev *pci)
/* check pci quirks */
if (pci_pci_problems & PCIPCI_TRITON) {
printk(KERN_INFO "%s: quirk: PCIPCI_TRITON -- set TBFX\n",
name);
pr_info("quirk: PCIPCI_TRITON -- set TBFX\n");
ctrl |= CX88X_EN_TBFX;
}
if (pci_pci_problems & PCIPCI_NATOMA) {
printk(KERN_INFO "%s: quirk: PCIPCI_NATOMA -- set TBFX\n",
name);
pr_info("quirk: PCIPCI_NATOMA -- set TBFX\n");
ctrl |= CX88X_EN_TBFX;
}
if (pci_pci_problems & PCIPCI_VIAETBF) {
printk(KERN_INFO "%s: quirk: PCIPCI_VIAETBF -- set TBFX\n",
name);
pr_info("quirk: PCIPCI_VIAETBF -- set TBFX\n");
ctrl |= CX88X_EN_TBFX;
}
if (pci_pci_problems & PCIPCI_VSFX) {
printk(KERN_INFO "%s: quirk: PCIPCI_VSFX -- set VSFX\n",
name);
pr_info("quirk: PCIPCI_VSFX -- set VSFX\n");
ctrl |= CX88X_EN_VSFX;
}
#ifdef PCIPCI_ALIMAGIK
if (pci_pci_problems & PCIPCI_ALIMAGIK) {
printk(KERN_INFO "%s: quirk: PCIPCI_ALIMAGIK -- latency fixup\n",
name);
pr_info("quirk: PCIPCI_ALIMAGIK -- latency fixup\n");
lat = 0x0A;
}
#endif
......@@ -3646,8 +3626,8 @@ static int cx88_pci_quirks(const char *name, struct pci_dev *pci)
pci_write_config_byte(pci, CX88X_DEVCTRL, value);
}
if (UNSET != lat) {
printk(KERN_INFO "%s: setting pci latency timer to %d\n",
name, latency);
pr_info("setting pci latency timer to %d\n",
latency);
pci_write_config_byte(pci, PCI_LATENCY_TIMER, latency);
}
return 0;
......@@ -3659,9 +3639,8 @@ int cx88_get_resources(const struct cx88_core *core, struct pci_dev *pci)
pci_resource_len(pci,0),
core->name))
return 0;
printk(KERN_ERR
"%s/%d: Can't get MMIO memory @ 0x%llx, subsystem: %04x:%04x\n",
core->name, PCI_FUNC(pci->devfn),
pr_err("func %d: Can't get MMIO memory @ 0x%llx, subsystem: %04x:%04x\n",
PCI_FUNC(pci->devfn),
(unsigned long long)pci_resource_start(pci, 0),
pci->subsystem_vendor, pci->subsystem_device);
return -EBUSY;
......@@ -3755,7 +3734,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
if (!core->board.num_frontends && (core->board.mpeg & CX88_MPEG_DVB))
core->board.num_frontends = 1;
info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n",
pr_info("subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n",
pci->subsystem_vendor, pci->subsystem_device, core->board.name,
core->boardnr, card[core->nr] == core->boardnr ?
"insmod option" : "autodetected",
......
This diff is collapsed.
......@@ -19,15 +19,15 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "cx88.h"
#include "cx88-reg.h"
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/jiffies.h>
#include <asm/div64.h>
#include "cx88.h"
#include "cx88-reg.h"
#define INT_PI ((s32)(3.141592653589 * 32768.0))
#define compat_remainder(a, b) \
......@@ -71,8 +71,11 @@ static unsigned int dsp_debug;
module_param(dsp_debug, int, 0644);
MODULE_PARM_DESC(dsp_debug, "enable audio dsp debug messages");
#define dprintk(level, fmt, arg...) if (dsp_debug >= level) \
printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg)
#define dprintk(level, fmt, arg...) do { \
if (dsp_debug >= level) \
printk(KERN_DEBUG pr_fmt("%s: dsp:" fmt), \
__func__, ##arg); \
} while (0)
static s32 int_cos(u32 x)
{
......@@ -176,8 +179,8 @@ static s32 detect_a2_a2m_eiaj(struct cx88_core *core, s16 x[], u32 N)
dual_freq = FREQ_EIAJ_DUAL;
break;
default:
printk(KERN_WARNING "%s/0: unsupported audio mode %d for %s\n",
core->name, core->tvaudio, __func__);
pr_warn("unsupported audio mode %d for %s\n",
core->tvaudio, __func__);
return UNSET;
}
......
......@@ -21,6 +21,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "cx88.h"
#include "dvb-pll.h"
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
......@@ -29,8 +32,6 @@
#include <linux/file.h>
#include <linux/suspend.h>
#include "cx88.h"
#include "dvb-pll.h"
#include <media/v4l2-common.h>
#include "mt352.h"
......@@ -77,8 +78,11 @@ MODULE_PARM_DESC(dvb_buf_tscnt, "DVB Buffer TS count [dvb]");
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(level,fmt, arg...) if (debug >= level) \
printk(KERN_DEBUG "%s/2-dvb: " fmt, core->name, ## arg)
#define dprintk(level, fmt, arg...) do { \
if (debug >= level) \
printk(KERN_DEBUG pr_fmt("%s: dvb:" fmt), \
__func__, ##arg); \
} while (0)
/* ------------------------------------------------------------------ */
......@@ -178,7 +182,7 @@ static int cx88_dvb_bus_ctrl(struct dvb_frontend* fe, int acquire)
fe_id = vb2_dvb_find_frontend(&dev->frontends, fe);
if (!fe_id) {
printk(KERN_ERR "%s() No frontend found\n", __func__);
pr_err("%s() No frontend found\n", __func__);
return -EINVAL;
}
......@@ -625,8 +629,7 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev)
return -EINVAL;
if (!fe0->dvb.frontend) {
printk(KERN_ERR "%s/2: dvb frontend not attached. Can't attach xc3028\n",
dev->core->name);
pr_err("dvb frontend not attached. Can't attach xc3028\n");
return -EINVAL;
}
......@@ -639,16 +642,14 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev)
fe = dvb_attach(xc2028_attach, fe0->dvb.frontend, &cfg);
if (!fe) {
printk(KERN_ERR "%s/2: xc3028 attach failed\n",
dev->core->name);
pr_err("xc3028 attach failed\n");
dvb_frontend_detach(fe0->dvb.frontend);
dvb_unregister_frontend(fe0->dvb.frontend);
fe0->dvb.frontend = NULL;
return -EINVAL;
}
printk(KERN_INFO "%s/2: xc3028 attached\n",
dev->core->name);
pr_info("xc3028 attached\n");
return 0;
}
......@@ -664,23 +665,21 @@ static int attach_xc4000(struct cx8802_dev *dev, struct xc4000_config *cfg)
return -EINVAL;
if (!fe0->dvb.frontend) {
printk(KERN_ERR "%s/2: dvb frontend not attached. Can't attach xc4000\n",
dev->core->name);
pr_err("dvb frontend not attached. Can't attach xc4000\n");
return -EINVAL;
}
fe = dvb_attach(xc4000_attach, fe0->dvb.frontend, &dev->core->i2c_adap,
cfg);
if (!fe) {
printk(KERN_ERR "%s/2: xc4000 attach failed\n",
dev->core->name);
pr_err("xc4000 attach failed\n");
dvb_frontend_detach(fe0->dvb.frontend);
dvb_unregister_frontend(fe0->dvb.frontend);
fe0->dvb.frontend = NULL;
return -EINVAL;
}
printk(KERN_INFO "%s/2: xc4000 attached\n", dev->core->name);
pr_info("xc4000 attached\n");
return 0;
}
......@@ -798,12 +797,12 @@ static int cx8802_alloc_frontends(struct cx8802_dev *dev)
if (!core->board.num_frontends)
return -ENODEV;
printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__,
pr_info("%s: allocating %d frontend(s)\n", __func__,
core->board.num_frontends);
for (i = 1; i <= core->board.num_frontends; i++) {
fe = vb2_dvb_alloc_frontend(&dev->frontends, i);
if (!fe) {
printk(KERN_ERR "%s() failed to alloc\n", __func__);
pr_err("%s() failed to alloc\n", __func__);
vb2_dvb_dealloc_frontends(&dev->frontends);
return -ENOMEM;
}
......@@ -1007,7 +1006,7 @@ static int dvb_register(struct cx8802_dev *dev)
int res = -EINVAL;
if (0 != core->i2c_rc) {
printk(KERN_ERR "%s/2: no i2c-bus available, cannot attach dvb drivers\n", core->name);
pr_err("no i2c-bus available, cannot attach dvb drivers\n");
goto frontend_detach;
}
......@@ -1182,8 +1181,7 @@ static int dvb_register(struct cx8802_dev *dev)
goto frontend_detach;
}
#else
printk(KERN_ERR "%s/2: built without vp3054 support\n",
core->name);
pr_err("built without vp3054 support\n");
#endif
break;
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
......@@ -1615,15 +1613,12 @@ static int dvb_register(struct cx8802_dev *dev)
break;
default:
printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n",
core->name);
pr_err("The frontend of your DVB/ATSC card isn't supported yet\n");
break;
}
if ( (NULL == fe0->dvb.frontend) || (fe1 && NULL == fe1->dvb.frontend) ) {
printk(KERN_ERR
"%s/2: frontend initialization failed\n",
core->name);
pr_err("frontend initialization failed\n");
goto frontend_detach;
}
/* define general-purpose callback pointer */
......@@ -1762,7 +1757,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
goto fail_core;
/* dvb stuff */
printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name);
pr_info("cx2388x based DVB/ATSC card\n");
dev->ts_gen_cntrl = 0x0c;
err = cx8802_alloc_frontends(dev);
......@@ -1774,7 +1769,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
fe = vb2_dvb_get_frontend(&core->dvbdev->frontends, i);
if (fe == NULL) {
printk(KERN_ERR "%s() failed to get frontend(%d)\n",
pr_err("%s() failed to get frontend(%d)\n",
__func__, i);
err = -ENODEV;
goto fail_probe;
......@@ -1803,8 +1798,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
err = dvb_register(dev);
if (err)
/* frontends/adapter de-allocated in dvb_register */
printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n",
core->name, err);
pr_err("dvb_register failed (err = %d)\n", err);
return err;
fail_probe:
vb2_dvb_dealloc_frontends(&core->dvbdev->frontends);
......@@ -1839,8 +1833,7 @@ static struct cx8802_driver cx8802_dvb_driver = {
static int __init dvb_init(void)
{
printk(KERN_INFO "cx88/2: cx2388x dvb driver version %s loaded\n",
CX88_VERSION);
pr_info("cx2388x dvb driver version %s loaded\n", CX88_VERSION);
return cx8802_register_driver(&cx8802_dvb_driver);
}
......
......@@ -27,12 +27,13 @@
*/
#include "cx88.h"
#include <linux/module.h>
#include <linux/init.h>
#include <asm/io.h>
#include "cx88.h"
#include <media/v4l2-common.h>
static unsigned int i2c_debug;
......@@ -47,8 +48,11 @@ static unsigned int i2c_udelay = 5;
module_param(i2c_udelay, int, 0644);
MODULE_PARM_DESC(i2c_udelay, "i2c delay at insmod time, in usecs (should be 5 or higher). Lower value means higher bus speed.");
#define dprintk(level,fmt, arg...) if (i2c_debug >= level) \
printk(KERN_DEBUG "%s: " fmt, core->name , ## arg)
#define dprintk(level, fmt, arg...) do { \
if (i2c_debug >= level) \
printk(KERN_DEBUG pr_fmt("%s: i2c:" fmt), \
__func__, ##arg); \
} while (0)
/* ----------------------------------------------------------------------- */
......@@ -126,8 +130,8 @@ static void do_i2c_scan(const char *name, struct i2c_client *c)
rc = i2c_master_recv(c,&buf,0);
if (rc < 0)
continue;
printk("%s: i2c scan: found device @ 0x%x [%s]\n",
name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???");
pr_info("i2c scan: found device @ 0x%x [%s]\n",
i << 1, i2c_devs[i] ? i2c_devs[i] : "???");
}
}
......@@ -166,8 +170,7 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
case CX88_BOARD_HAUPPAUGE_HVR1300:
case CX88_BOARD_HAUPPAUGE_HVR3000:
case CX88_BOARD_HAUPPAUGE_HVR4000:
printk("%s: i2c init: enabling analog demod on HVR1300/3000/4000 tuner\n",
core->name);
pr_info("i2c init: enabling analog demod on HVR1300/3000/4000 tuner\n");
i2c_transfer(core->i2c_client.adapter, &tuner_msg, 1);
break;
default:
......@@ -176,7 +179,7 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
if (i2c_scan)
do_i2c_scan(core->name,&core->i2c_client);
} else
printk("%s: i2c register FAILED\n", core->name);
pr_err("i2c register FAILED\n");
return core->i2c_rc;
}
......@@ -22,13 +22,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "cx88.h"
#include <linux/init.h>
#include <linux/hrtimer.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/module.h>
#include "cx88.h"
#include <media/rc-core.h>
#define MODULE_NAME "cx88xx"
......
This diff is collapsed.
......@@ -35,6 +35,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "cx88.h"
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/freezer.h>
......@@ -50,8 +52,6 @@
#include <linux/delay.h>
#include <linux/kthread.h>
#include "cx88.h"
static unsigned int audio_debug;
module_param(audio_debug, int, 0644);
MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]");
......@@ -64,9 +64,11 @@ static unsigned int radio_deemphasis;
module_param(radio_deemphasis,int,0644);
MODULE_PARM_DESC(radio_deemphasis, "Radio deemphasis time constant, 0=None, 1=50us (elsewhere), 2=75us (USA)");
#define dprintk(fmt, arg...) if (audio_debug) \
printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg)
#define dprintk(fmt, arg...) do { \
if (audio_debug) \
printk(KERN_DEBUG pr_fmt("%s: tvaudio:" fmt), \
__func__, ##arg); \
} while (0)
/* ----------------------------------------------------------- */
static const char * const aud_ctl_names[64] = {
......@@ -797,8 +799,7 @@ void cx88_set_tvaudio(struct cx88_core *core)
break;
case WW_NONE:
case WW_I2SPT:
printk("%s/0: unknown tv audio mode [%d]\n",
core->name, core->tvaudio);
pr_info("unknown tv audio mode [%d]\n", core->tvaudio);
break;
}
return;
......
/*
*/
#include "cx88.h"
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include "cx88.h"
static unsigned int vbi_debug;
module_param(vbi_debug,int,0644);
MODULE_PARM_DESC(vbi_debug,"enable debug messages [vbi]");
#define dprintk(level,fmt, arg...) if (vbi_debug >= level) \
printk(KERN_DEBUG "%s: " fmt, dev->core->name , ## arg)
#define dprintk(level, fmt, arg...) do { \
if (vbi_debug >= level) \
printk(KERN_DEBUG pr_fmt("%s: vbi:" fmt), \
__func__, ##arg); \
} while (0)
/* ------------------------------------------------------------------ */
......
......@@ -25,6 +25,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "cx88.h"
#include <linux/init.h>
#include <linux/list.h>
#include <linux/module.h>
......@@ -37,7 +39,6 @@
#include <linux/kthread.h>
#include <asm/div64.h>
#include "cx88.h"
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
......@@ -70,8 +71,12 @@ static unsigned int irq_debug;
module_param(irq_debug,int,0644);
MODULE_PARM_DESC(irq_debug,"enable debug messages [IRQ handler]");
#define dprintk(level,fmt, arg...) if (video_debug >= level) \
printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg)
#define dprintk(level, fmt, arg...) do { \
if (video_debug >= level) \
printk(KERN_DEBUG pr_fmt("%s: video:" fmt), \
__func__, ##arg); \
} while (0)
/* ------------------------------------------------------------------- */
/* static data */
......@@ -414,7 +419,6 @@ static int stop_video_dma(struct cx8800_dev *dev)
static int restart_video_queue(struct cx8800_dev *dev,
struct cx88_dmaqueue *q)
{
struct cx88_core *core = dev->core;
struct cx88_buffer *buf;
if (!list_empty(&q->active)) {
......@@ -513,7 +517,6 @@ static void buffer_queue(struct vb2_buffer *vb)
struct cx8800_dev *dev = vb->vb2_queue->drv_priv;
struct cx88_buffer *buf = container_of(vbuf, struct cx88_buffer, vb);
struct cx88_buffer *prev;
struct cx88_core *core = dev->core;
struct cx88_dmaqueue *q = &dev->vidq;
/* add jump to start */
......@@ -1090,13 +1093,13 @@ static void cx8800_vid_irq(struct cx8800_dev *dev)
return;
cx_write(MO_VID_INTSTAT, status);
if (irq_debug || (status & mask & ~0xff))
cx88_print_irqbits(core->name, "irq vid",
cx88_print_irqbits("irq vid",
cx88_vid_irqs, ARRAY_SIZE(cx88_vid_irqs),
status, mask);
/* risc op code error */
if (status & (1 << 16)) {
printk(KERN_WARNING "%s/0: video risc op code error\n",core->name);
pr_warn("video risc op code error\n");
cx_clear(MO_VID_DMACNTRL, 0x11);
cx_clear(VID_CAPTURE_CONTROL, 0x06);
cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH21]);
......@@ -1140,8 +1143,7 @@ static irqreturn_t cx8800_irq(int irq, void *dev_id)
cx8800_vid_irq(dev);
}
if (10 == loop) {
printk(KERN_WARNING "%s/0: irq loop -- clearing mask\n",
core->name);
pr_warn("irq loop -- clearing mask\n");
cx_write(MO_PCI_INTMSK,0);
}
......@@ -1307,15 +1309,15 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
/* print pci info */
dev->pci_rev = pci_dev->revision;
pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat);
printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, latency: %d, mmio: 0x%llx\n",
core->name,
pr_info("found at %s, rev: %d, irq: %d, latency: %d, mmio: 0x%llx\n",
pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
dev->pci_lat,
(unsigned long long)pci_resource_start(pci_dev, 0));
pci_set_master(pci_dev);
err = pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32));
if (err) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
pr_err("Oops: no 32bit PCI DMA ???\n");
goto fail_core;
}
......@@ -1332,8 +1334,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
err = request_irq(pci_dev->irq, cx8800_irq,
IRQF_SHARED, core->name, dev);
if (err < 0) {
printk(KERN_ERR "%s/0: can't get IRQ %d\n",
core->name,pci_dev->irq);
pr_err("can't get IRQ %d\n", pci_dev->irq);
goto fail_core;
}
cx_set(MO_PCI_INTMSK, core->pci_irqmask);
......@@ -1470,12 +1471,11 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
err = video_register_device(&dev->video_dev, VFL_TYPE_GRABBER,
video_nr[core->nr]);
if (err < 0) {
printk(KERN_ERR "%s/0: can't register video device\n",
core->name);
pr_err("can't register video device\n");
goto fail_unreg;
}
printk(KERN_INFO "%s/0: registered device %s [v4l2]\n",
core->name, video_device_node_name(&dev->video_dev));
pr_info("registered device %s [v4l2]\n",
video_device_node_name(&dev->video_dev));
cx88_vdev_init(core, dev->pci, &dev->vbi_dev,
&cx8800_vbi_template, "vbi");
......@@ -1484,12 +1484,11 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
err = video_register_device(&dev->vbi_dev, VFL_TYPE_VBI,
vbi_nr[core->nr]);
if (err < 0) {
printk(KERN_ERR "%s/0: can't register vbi device\n",
core->name);
pr_err("can't register vbi device\n");
goto fail_unreg;
}
printk(KERN_INFO "%s/0: registered device %s\n",
core->name, video_device_node_name(&dev->vbi_dev));
pr_info("registered device %s\n",
video_device_node_name(&dev->vbi_dev));
if (core->board.radio.type == CX88_RADIO) {
cx88_vdev_init(core, dev->pci, &dev->radio_dev,
......@@ -1499,12 +1498,11 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
err = video_register_device(&dev->radio_dev, VFL_TYPE_RADIO,
radio_nr[core->nr]);
if (err < 0) {
printk(KERN_ERR "%s/0: can't register radio device\n",
core->name);
pr_err("can't register radio device\n");
goto fail_unreg;
}
printk(KERN_INFO "%s/0: registered device %s\n",
core->name, video_device_node_name(&dev->radio_dev));
pr_info("registered device %s\n",
video_device_node_name(&dev->radio_dev));
}
/* start tvaudio thread */
......@@ -1512,8 +1510,8 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
core->kthread = kthread_run(cx88_audio_thread, core, "cx88 tvaudio");
if (IS_ERR(core->kthread)) {
err = PTR_ERR(core->kthread);
printk(KERN_ERR "%s/0: failed to create cx88 audio thread, err=%d\n",
core->name, err);
pr_err("failed to create cx88 audio thread, err=%d\n",
err);
}
}
mutex_unlock(&core->lock);
......@@ -1571,11 +1569,11 @@ static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state)
/* stop video+vbi capture */
spin_lock_irqsave(&dev->slock, flags);
if (!list_empty(&dev->vidq.active)) {
printk("%s/0: suspend video\n", core->name);
pr_info("suspend video\n");
stop_video_dma(dev);
}
if (!list_empty(&dev->vbiq.active)) {
printk("%s/0: suspend vbi\n", core->name);
pr_info("suspend vbi\n");
cx8800_stop_vbi_dma(dev);
}
spin_unlock_irqrestore(&dev->slock, flags);
......@@ -1603,8 +1601,7 @@ static int cx8800_resume(struct pci_dev *pci_dev)
if (dev->state.disabled) {
err=pci_enable_device(pci_dev);
if (err) {
printk(KERN_ERR "%s/0: can't enable device\n",
core->name);
pr_err("can't enable device\n");
return err;
}
......@@ -1612,7 +1609,7 @@ static int cx8800_resume(struct pci_dev *pci_dev)
}
err= pci_set_power_state(pci_dev, PCI_D0);
if (err) {
printk(KERN_ERR "%s/0: can't set power state\n", core->name);
pr_err("can't set power state\n");
pci_disable_device(pci_dev);
dev->state.disabled = 1;
......@@ -1630,11 +1627,11 @@ static int cx8800_resume(struct pci_dev *pci_dev)
/* restart video+vbi capture */
spin_lock_irqsave(&dev->slock, flags);
if (!list_empty(&dev->vidq.active)) {
printk("%s/0: resume video\n", core->name);
pr_info("resume video\n");
restart_video_queue(dev,&dev->vidq);
}
if (!list_empty(&dev->vbiq.active)) {
printk("%s/0: resume vbi\n", core->name);
pr_info("resume vbi\n");
cx8800_restart_vbi_queue(dev,&dev->vbiq);
}
spin_unlock_irqrestore(&dev->slock, flags);
......
......@@ -22,15 +22,15 @@
*/
#include "cx88.h"
#include "cx88-vp3054-i2c.h"
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <asm/io.h>
#include "cx88.h"
#include "cx88-vp3054-i2c.h"
MODULE_DESCRIPTION("driver for cx2388x VP3054 design");
MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
MODULE_LICENSE("GPL");
......@@ -133,7 +133,7 @@ int vp3054_i2c_probe(struct cx8802_dev *dev)
rc = i2c_bit_add_bus(&vp3054_i2c->adap);
if (0 != rc) {
printk("%s: vp3054_i2c register FAILED\n", core->name);
pr_err("vp3054_i2c register FAILED\n");
kfree(dev->vp3054);
dev->vp3054 = NULL;
......
......@@ -19,6 +19,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef CX88_H
#define CX88_H
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/pci.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
......@@ -614,7 +619,7 @@ struct cx8802_dev {
extern unsigned int cx88_core_debug;
extern void cx88_print_irqbits(const char *name, const char *tag, const char *strings[],
extern void cx88_print_irqbits(const char *tag, const char *strings[],
int len, u32 bits, u32 mask);
extern int cx88_core_irq(struct cx88_core *core, u32 status);
......@@ -738,3 +743,5 @@ int cx88_set_freq(struct cx88_core *core, const struct v4l2_frequency *f);
int cx88_video_mux(struct cx88_core *core, unsigned int input);
void cx88_querycap(struct file *file, struct cx88_core *core,
struct v4l2_capability *cap);
#endif
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