Commit 3b795d01 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] cx231xx: use dev_foo instead of printk

There are several places at cx231xx that uses printk without
any special reason. Change all of them to use dev_foo().
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 56d8a3b0
...@@ -1208,7 +1208,8 @@ int cx231xx_set_audio_decoder_input(struct cx231xx *dev, ...@@ -1208,7 +1208,8 @@ int cx231xx_set_audio_decoder_input(struct cx231xx *dev,
/* This is just a casual suggestion to people adding /* This is just a casual suggestion to people adding
new boards in case they use a tuner type we don't new boards in case they use a tuner type we don't
currently know about */ currently know about */
printk(KERN_INFO "Unknown tuner type configuring SIF"); dev_info(&dev->udev->dev,
"Unknown tuner type configuring SIF");
break; break;
} }
break; break;
......
...@@ -1216,11 +1216,11 @@ static int cx231xx_init_dev(struct cx231xx *dev, struct usb_device *udev, ...@@ -1216,11 +1216,11 @@ static int cx231xx_init_dev(struct cx231xx *dev, struct usb_device *udev,
cx231xx_add_into_devlist(dev); cx231xx_add_into_devlist(dev);
if (dev->board.has_417) { if (dev->board.has_417) {
printk(KERN_INFO "attach 417 %d\n", dev->model); dev_info(&udev->dev, "attach 417 %d\n", dev->model);
if (cx231xx_417_register(dev) < 0) { if (cx231xx_417_register(dev) < 0) {
printk(KERN_ERR dev_err(&udev->dev,
"%s() Failed to register 417 on VID_B\n", "%s() Failed to register 417 on VID_B\n",
__func__); __func__);
} }
} }
......
...@@ -45,11 +45,6 @@ MODULE_PARM_DESC(debug, "enable debug messages [dvb]"); ...@@ -45,11 +45,6 @@ MODULE_PARM_DESC(debug, "enable debug messages [dvb]");
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(level, fmt, arg...) do { \
if (debug >= level) \
printk(KERN_DEBUG "%s/2-dvb: " fmt, dev->name, ## arg); \
} while (0)
#define CX231XX_DVB_NUM_BUFS 5 #define CX231XX_DVB_NUM_BUFS 5
#define CX231XX_DVB_MAX_PACKETSIZE 564 #define CX231XX_DVB_MAX_PACKETSIZE 564
#define CX231XX_DVB_MAX_PACKETS 64 #define CX231XX_DVB_MAX_PACKETS 64
...@@ -196,9 +191,11 @@ static inline void print_err_status(struct cx231xx *dev, int packet, int status) ...@@ -196,9 +191,11 @@ static inline void print_err_status(struct cx231xx *dev, int packet, int status)
break; break;
} }
if (packet < 0) { if (packet < 0) {
dprintk(1, "URB status %d [%s].\n", status, errmsg); dev_dbg(&dev->udev->dev,
"URB status %d [%s].\n", status, errmsg);
} else { } else {
dprintk(1, "URB packet %d, status %d [%s].\n", dev_dbg(&dev->udev->dev,
"URB packet %d, status %d [%s].\n",
packet, status, errmsg); packet, status, errmsg);
} }
} }
...@@ -377,20 +374,21 @@ static int attach_xc5000(u8 addr, struct cx231xx *dev) ...@@ -377,20 +374,21 @@ static int attach_xc5000(u8 addr, struct cx231xx *dev)
cfg.i2c_addr = addr; cfg.i2c_addr = addr;
if (!dev->dvb->frontend) { if (!dev->dvb->frontend) {
printk(KERN_ERR "%s/2: dvb frontend not attached. " dev_err(&dev->udev->dev, "%s/2: dvb frontend not attached. "
"Can't attach xc5000\n", dev->name); "Can't attach xc5000\n", dev->name);
return -EINVAL; return -EINVAL;
} }
fe = dvb_attach(xc5000_attach, dev->dvb->frontend, &cfg); fe = dvb_attach(xc5000_attach, dev->dvb->frontend, &cfg);
if (!fe) { if (!fe) {
printk(KERN_ERR "%s/2: xc5000 attach failed\n", dev->name); dev_err(&dev->udev->dev,
"%s/2: xc5000 attach failed\n", dev->name);
dvb_frontend_detach(dev->dvb->frontend); dvb_frontend_detach(dev->dvb->frontend);
dev->dvb->frontend = NULL; dev->dvb->frontend = NULL;
return -EINVAL; return -EINVAL;
} }
printk(KERN_INFO "%s/2: xc5000 attached\n", dev->name); dev_info(&dev->udev->dev, "%s/2: xc5000 attached\n", dev->name);
return 0; return 0;
} }
...@@ -462,7 +460,7 @@ static int register_dvb(struct cx231xx_dvb *dvb, ...@@ -462,7 +460,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
result = dvb_register_adapter(&dvb->adapter, dev->name, module, device, result = dvb_register_adapter(&dvb->adapter, dev->name, module, device,
adapter_nr); adapter_nr);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING dev_warn(&dev->udev->dev,
"%s: dvb_register_adapter failed (errno = %d)\n", "%s: dvb_register_adapter failed (errno = %d)\n",
dev->name, result); dev->name, result);
goto fail_adapter; goto fail_adapter;
...@@ -476,7 +474,7 @@ static int register_dvb(struct cx231xx_dvb *dvb, ...@@ -476,7 +474,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
/* register frontend */ /* register frontend */
result = dvb_register_frontend(&dvb->adapter, dvb->frontend); result = dvb_register_frontend(&dvb->adapter, dvb->frontend);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING dev_warn(&dev->udev->dev,
"%s: dvb_register_frontend failed (errno = %d)\n", "%s: dvb_register_frontend failed (errno = %d)\n",
dev->name, result); dev->name, result);
goto fail_frontend; goto fail_frontend;
...@@ -494,7 +492,8 @@ static int register_dvb(struct cx231xx_dvb *dvb, ...@@ -494,7 +492,8 @@ static int register_dvb(struct cx231xx_dvb *dvb,
result = dvb_dmx_init(&dvb->demux); result = dvb_dmx_init(&dvb->demux);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: dvb_dmx_init failed (errno = %d)\n", dev_warn(&dev->udev->dev,
"%s: dvb_dmx_init failed (errno = %d)\n",
dev->name, result); dev->name, result);
goto fail_dmx; goto fail_dmx;
} }
...@@ -504,15 +503,16 @@ static int register_dvb(struct cx231xx_dvb *dvb, ...@@ -504,15 +503,16 @@ static int register_dvb(struct cx231xx_dvb *dvb,
dvb->dmxdev.capabilities = 0; dvb->dmxdev.capabilities = 0;
result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: dvb_dmxdev_init failed (errno = %d)\n", dev_warn(&dev->udev->dev,
dev->name, result); "%s: dvb_dmxdev_init failed (errno = %d)\n",
dev->name, result);
goto fail_dmxdev; goto fail_dmxdev;
} }
dvb->fe_hw.source = DMX_FRONTEND_0; dvb->fe_hw.source = DMX_FRONTEND_0;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw); result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING dev_warn(&dev->udev->dev,
"%s: add_frontend failed (DMX_FRONTEND_0, errno = %d)\n", "%s: add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
dev->name, result); dev->name, result);
goto fail_fe_hw; goto fail_fe_hw;
...@@ -521,17 +521,17 @@ static int register_dvb(struct cx231xx_dvb *dvb, ...@@ -521,17 +521,17 @@ static int register_dvb(struct cx231xx_dvb *dvb,
dvb->fe_mem.source = DMX_MEMORY_FE; dvb->fe_mem.source = DMX_MEMORY_FE;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem); result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING dev_warn(&dev->udev->dev,
"%s: add_frontend failed (DMX_MEMORY_FE, errno = %d)\n", "%s: add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
dev->name, result); dev->name, result);
goto fail_fe_mem; goto fail_fe_mem;
} }
result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw); result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING dev_warn(&dev->udev->dev,
"%s: connect_frontend failed (errno = %d)\n", dev->name, "%s: connect_frontend failed (errno = %d)\n",
result); dev->name, result);
goto fail_fe_conn; goto fail_fe_conn;
} }
...@@ -590,7 +590,8 @@ static int dvb_init(struct cx231xx *dev) ...@@ -590,7 +590,8 @@ static int dvb_init(struct cx231xx *dev)
dvb = kzalloc(sizeof(struct cx231xx_dvb), GFP_KERNEL); dvb = kzalloc(sizeof(struct cx231xx_dvb), GFP_KERNEL);
if (dvb == NULL) { if (dvb == NULL) {
printk(KERN_INFO "cx231xx_dvb: memory allocation failed\n"); dev_info(&dev->udev->dev,
"cx231xx_dvb: memory allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
dev->dvb = dvb; dev->dvb = dvb;
...@@ -612,8 +613,8 @@ static int dvb_init(struct cx231xx *dev) ...@@ -612,8 +613,8 @@ static int dvb_init(struct cx231xx *dev)
demod_i2c); demod_i2c);
if (dev->dvb->frontend == NULL) { if (dev->dvb->frontend == NULL) {
printk(DRIVER_NAME dev_err(&dev->udev->dev,
": Failed to attach s5h1432 front end\n"); "Failed to attach s5h1432 front end\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -637,8 +638,8 @@ static int dvb_init(struct cx231xx *dev) ...@@ -637,8 +638,8 @@ static int dvb_init(struct cx231xx *dev)
demod_i2c); demod_i2c);
if (dev->dvb->frontend == NULL) { if (dev->dvb->frontend == NULL) {
printk(DRIVER_NAME dev_err(&dev->udev->dev,
": Failed to attach s5h1411 front end\n"); "Failed to attach s5h1411 front end\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -660,8 +661,8 @@ static int dvb_init(struct cx231xx *dev) ...@@ -660,8 +661,8 @@ static int dvb_init(struct cx231xx *dev)
demod_i2c); demod_i2c);
if (dev->dvb->frontend == NULL) { if (dev->dvb->frontend == NULL) {
printk(DRIVER_NAME dev_err(&dev->udev->dev,
": Failed to attach s5h1432 front end\n"); "Failed to attach s5h1432 front end\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -684,8 +685,8 @@ static int dvb_init(struct cx231xx *dev) ...@@ -684,8 +685,8 @@ static int dvb_init(struct cx231xx *dev)
demod_i2c); demod_i2c);
if (dev->dvb->frontend == NULL) { if (dev->dvb->frontend == NULL) {
printk(DRIVER_NAME dev_err(&dev->udev->dev,
": Failed to attach s5h1411 front end\n"); "Failed to attach s5h1411 front end\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -702,7 +703,8 @@ static int dvb_init(struct cx231xx *dev) ...@@ -702,7 +703,8 @@ static int dvb_init(struct cx231xx *dev)
break; break;
case CX231XX_BOARD_HAUPPAUGE_EXETER: case CX231XX_BOARD_HAUPPAUGE_EXETER:
printk(KERN_INFO "%s: looking for tuner / demod on i2c bus: %d\n", dev_info(&dev->udev->dev,
"%s: looking for tuner / demod on i2c bus: %d\n",
__func__, i2c_adapter_id(tuner_i2c)); __func__, i2c_adapter_id(tuner_i2c));
dev->dvb->frontend = dvb_attach(lgdt3305_attach, dev->dvb->frontend = dvb_attach(lgdt3305_attach,
...@@ -710,8 +712,8 @@ static int dvb_init(struct cx231xx *dev) ...@@ -710,8 +712,8 @@ static int dvb_init(struct cx231xx *dev)
tuner_i2c); tuner_i2c);
if (dev->dvb->frontend == NULL) { if (dev->dvb->frontend == NULL) {
printk(DRIVER_NAME dev_err(&dev->udev->dev,
": Failed to attach LG3305 front end\n"); "Failed to attach LG3305 front end\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -732,8 +734,8 @@ static int dvb_init(struct cx231xx *dev) ...@@ -732,8 +734,8 @@ static int dvb_init(struct cx231xx *dev)
); );
if (dev->dvb->frontend == NULL) { if (dev->dvb->frontend == NULL) {
printk(DRIVER_NAME dev_err(&dev->udev->dev,
": Failed to attach SI2165 front end\n"); "Failed to attach SI2165 front end\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -765,8 +767,8 @@ static int dvb_init(struct cx231xx *dev) ...@@ -765,8 +767,8 @@ static int dvb_init(struct cx231xx *dev)
); );
if (dev->dvb->frontend == NULL) { if (dev->dvb->frontend == NULL) {
printk(DRIVER_NAME dev_err(&dev->udev->dev,
": Failed to attach SI2165 front end\n"); "Failed to attach SI2165 front end\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -810,16 +812,17 @@ static int dvb_init(struct cx231xx *dev) ...@@ -810,16 +812,17 @@ static int dvb_init(struct cx231xx *dev)
case CX231XX_BOARD_PV_PLAYTV_USB_HYBRID: case CX231XX_BOARD_PV_PLAYTV_USB_HYBRID:
case CX231XX_BOARD_KWORLD_UB430_USB_HYBRID: case CX231XX_BOARD_KWORLD_UB430_USB_HYBRID:
printk(KERN_INFO "%s: looking for demod on i2c bus: %d\n", dev_info(&dev->udev->dev,
__func__, i2c_adapter_id(tuner_i2c)); "%s: looking for demod on i2c bus: %d\n",
__func__, i2c_adapter_id(tuner_i2c));
dev->dvb->frontend = dvb_attach(mb86a20s_attach, dev->dvb->frontend = dvb_attach(mb86a20s_attach,
&pv_mb86a20s_config, &pv_mb86a20s_config,
demod_i2c); demod_i2c);
if (dev->dvb->frontend == NULL) { if (dev->dvb->frontend == NULL) {
printk(DRIVER_NAME dev_err(&dev->udev->dev,
": Failed to attach mb86a20s demod\n"); "Failed to attach mb86a20s demod\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -833,12 +836,13 @@ static int dvb_init(struct cx231xx *dev) ...@@ -833,12 +836,13 @@ static int dvb_init(struct cx231xx *dev)
break; break;
default: default:
printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card" dev_err(&dev->udev->dev,
" isn't supported yet\n", dev->name); "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n",
dev->name);
break; break;
} }
if (NULL == dvb->frontend) { if (NULL == dvb->frontend) {
printk(KERN_ERR dev_err(&dev->udev->dev,
"%s/2: frontend initialization failed\n", dev->name); "%s/2: frontend initialization failed\n", dev->name);
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
...@@ -851,7 +855,7 @@ static int dvb_init(struct cx231xx *dev) ...@@ -851,7 +855,7 @@ static int dvb_init(struct cx231xx *dev)
goto out_free; goto out_free;
printk(KERN_INFO "Successfully loaded cx231xx-dvb\n"); dev_info(&dev->udev->dev, "Successfully loaded cx231xx-dvb\n");
ret: ret:
cx231xx_set_mode(dev, CX231XX_SUSPEND); cx231xx_set_mode(dev, CX231XX_SUSPEND);
......
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