Commit 935c6654 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] drx-j: Replace printk's by pr_foo()

Instead of using printk's, use the pr_foo() macros.

That fixes some checkpatch warnings and provide a better error,
warning and debug support.
Acked-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 9482354f
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.= * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -44,7 +46,7 @@ static int drx39xxj_set_powerstate(struct dvb_frontend *fe, int enable) ...@@ -44,7 +46,7 @@ static int drx39xxj_set_powerstate(struct dvb_frontend *fe, int enable)
result = drx_ctrl(demod, DRX_CTRL_POWER_MODE, &power_mode); result = drx_ctrl(demod, DRX_CTRL_POWER_MODE, &power_mode);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "Power state change failed\n"); pr_err("Power state change failed\n");
return 0; return 0;
} }
...@@ -63,14 +65,14 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status) ...@@ -63,14 +65,14 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status)
result = drx_ctrl(demod, DRX_CTRL_LOCK_STATUS, &lock_status); result = drx_ctrl(demod, DRX_CTRL_LOCK_STATUS, &lock_status);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "drx39xxj: could not get lock status!\n"); pr_err("drx39xxj: could not get lock status!\n");
*status = 0; *status = 0;
} }
switch (lock_status) { switch (lock_status) {
case DRX_NEVER_LOCK: case DRX_NEVER_LOCK:
*status = 0; *status = 0;
printk(KERN_ERR "drx says NEVER_LOCK\n"); pr_err("drx says NEVER_LOCK\n");
break; break;
case DRX_NOT_LOCKED: case DRX_NOT_LOCKED:
*status = 0; *status = 0;
...@@ -93,7 +95,7 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status) ...@@ -93,7 +95,7 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status)
| FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK;
break; break;
default: default:
printk(KERN_ERR "Lock state unknown %d\n", lock_status); pr_err("Lock state unknown %d\n", lock_status);
} }
return 0; return 0;
...@@ -108,7 +110,7 @@ static int drx39xxj_read_ber(struct dvb_frontend *fe, u32 *ber) ...@@ -108,7 +110,7 @@ static int drx39xxj_read_ber(struct dvb_frontend *fe, u32 *ber)
result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "drx39xxj: could not get ber!\n"); pr_err("drx39xxj: could not get ber!\n");
*ber = 0; *ber = 0;
return 0; return 0;
} }
...@@ -127,7 +129,7 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend *fe, ...@@ -127,7 +129,7 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend *fe,
result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "drx39xxj: could not get signal strength!\n"); pr_err("drx39xxj: could not get signal strength!\n");
*strength = 0; *strength = 0;
return 0; return 0;
} }
...@@ -146,7 +148,7 @@ static int drx39xxj_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -146,7 +148,7 @@ static int drx39xxj_read_snr(struct dvb_frontend *fe, u16 *snr)
result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "drx39xxj: could not read snr!\n"); pr_err("drx39xxj: could not read snr!\n");
*snr = 0; *snr = 0;
return 0; return 0;
} }
...@@ -164,7 +166,7 @@ static int drx39xxj_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) ...@@ -164,7 +166,7 @@ static int drx39xxj_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "drx39xxj: could not get uc blocks!\n"); pr_err("drx39xxj: could not get uc blocks!\n");
*ucblocks = 0; *ucblocks = 0;
return 0; return 0;
} }
...@@ -218,7 +220,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe) ...@@ -218,7 +220,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
/* Set the standard (will be powered up if necessary */ /* Set the standard (will be powered up if necessary */
result = drx_ctrl(demod, DRX_CTRL_SET_STANDARD, &standard); result = drx_ctrl(demod, DRX_CTRL_SET_STANDARD, &standard);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "Failed to set standard! result=%02x\n", pr_err("Failed to set standard! result=%02x\n",
result); result);
return -EINVAL; return -EINVAL;
} }
...@@ -235,7 +237,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe) ...@@ -235,7 +237,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
/* program channel */ /* program channel */
result = drx_ctrl(demod, DRX_CTRL_SET_CHANNEL, &channel); result = drx_ctrl(demod, DRX_CTRL_SET_CHANNEL, &channel);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "Failed to set channel!\n"); pr_err("Failed to set channel!\n");
return -EINVAL; return -EINVAL;
} }
/* Just for giggles, let's shut off the LNA again.... */ /* Just for giggles, let's shut off the LNA again.... */
...@@ -243,14 +245,14 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe) ...@@ -243,14 +245,14 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
uio_data.value = false; uio_data.value = false;
result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data); result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "Failed to disable LNA!\n"); pr_err("Failed to disable LNA!\n");
return 0; return 0;
} }
#ifdef DJH_DEBUG #ifdef DJH_DEBUG
for (i = 0; i < 2000; i++) { for (i = 0; i < 2000; i++) {
fe_status_t status; fe_status_t status;
drx39xxj_read_status(fe, &status); drx39xxj_read_status(fe, &status);
printk(KERN_DBG "i=%d status=%d\n", i, status); pr_dbg("i=%d status=%d\n", i, status);
msleep(100); msleep(100);
i += 100; i += 100;
} }
...@@ -273,7 +275,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) ...@@ -273,7 +275,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
int result; int result;
#ifdef DJH_DEBUG #ifdef DJH_DEBUG
printk(KERN_DBG "i2c gate call: enable=%d state=%d\n", enable, pr_dbg("i2c gate call: enable=%d state=%d\n", enable,
state->i2c_gate_open); state->i2c_gate_open);
#endif #endif
...@@ -289,7 +291,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) ...@@ -289,7 +291,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
result = drx_ctrl(demod, DRX_CTRL_I2C_BRIDGE, &i2c_gate_state); result = drx_ctrl(demod, DRX_CTRL_I2C_BRIDGE, &i2c_gate_state);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "drx39xxj: could not open i2c gate [%d]\n", pr_err("drx39xxj: could not open i2c gate [%d]\n",
result); result);
dump_stack(); dump_stack();
} else { } else {
...@@ -383,7 +385,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c) ...@@ -383,7 +385,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
result = drx_open(demod); result = drx_open(demod);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "DRX open failed! Aborting\n"); pr_err("DRX open failed! Aborting\n");
kfree(state); kfree(state);
return NULL; return NULL;
} }
...@@ -394,7 +396,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c) ...@@ -394,7 +396,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
/* Configure user-I/O #3: enable read/write */ /* Configure user-I/O #3: enable read/write */
result = drx_ctrl(demod, DRX_CTRL_UIO_CFG, &uio_cfg); result = drx_ctrl(demod, DRX_CTRL_UIO_CFG, &uio_cfg);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "Failed to setup LNA GPIO!\n"); pr_err("Failed to setup LNA GPIO!\n");
return NULL; return NULL;
} }
...@@ -402,7 +404,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c) ...@@ -402,7 +404,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
uio_data.value = false; uio_data.value = false;
result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data); result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data);
if (result != 0) { if (result != 0) {
printk(KERN_ERR "Failed to disable LNA!\n"); pr_err("Failed to disable LNA!\n");
return NULL; return NULL;
} }
......
#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -99,11 +101,11 @@ int drxbsp_i2c_write_read(struct i2c_device_addr *w_dev_addr, ...@@ -99,11 +101,11 @@ int drxbsp_i2c_write_read(struct i2c_device_addr *w_dev_addr,
} }
if (state->i2c == NULL) { if (state->i2c == NULL) {
printk("i2c was zero, aborting\n"); pr_err("i2c was zero, aborting\n");
return 0; return 0;
} }
if (i2c_transfer(state->i2c, msg, num_msgs) != num_msgs) { if (i2c_transfer(state->i2c, msg, num_msgs) != num_msgs) {
printk(KERN_WARNING "drx3933: I2C write/read failed\n"); pr_warn("drx3933: I2C write/read failed\n");
return -EREMOTEIO; return -EREMOTEIO;
} }
...@@ -119,11 +121,11 @@ int drxbsp_i2c_write_read(struct i2c_device_addr *w_dev_addr, ...@@ -119,11 +121,11 @@ int drxbsp_i2c_write_read(struct i2c_device_addr *w_dev_addr,
.flags = I2C_M_RD, .buf = r_data, .len = r_count}, .flags = I2C_M_RD, .buf = r_data, .len = r_count},
}; };
printk("drx3933 i2c operation addr=%x i2c=%p, wc=%x rc=%x\n", pr_dbg("drx3933 i2c operation addr=%x i2c=%p, wc=%x rc=%x\n",
w_dev_addr->i2c_addr, state->i2c, w_count, r_count); w_dev_addr->i2c_addr, state->i2c, w_count, r_count);
if (i2c_transfer(state->i2c, msg, 2) != 2) { if (i2c_transfer(state->i2c, msg, 2) != 2) {
printk(KERN_WARNING "drx3933: I2C write/read failed\n"); pr_warn("drx3933: I2C write/read failed\n");
return -EREMOTEIO; return -EREMOTEIO;
} }
#endif #endif
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
INCLUDE FILES INCLUDE FILES
----------------------------------------------------------------------------*/ ----------------------------------------------------------------------------*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
#include "drxj.h" #include "drxj.h"
#include "drxj_map.h" #include "drxj_map.h"
......
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