* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
+
#include <linux/module.h>
#include <linux/init.h>
#include <linux/string.h>
result = drx_ctrl(demod, DRX_CTRL_POWER_MODE, &power_mode);
if (result != 0) {
- printk(KERN_ERR "Power state change failed\n");
+ pr_err("Power state change failed\n");
return 0;
}
result = drx_ctrl(demod, DRX_CTRL_LOCK_STATUS, &lock_status);
if (result != 0) {
- printk(KERN_ERR "drx39xxj: could not get lock status!\n");
+ pr_err("drx39xxj: could not get lock status!\n");
*status = 0;
}
switch (lock_status) {
case DRX_NEVER_LOCK:
*status = 0;
- printk(KERN_ERR "drx says NEVER_LOCK\n");
+ pr_err("drx says NEVER_LOCK\n");
break;
case DRX_NOT_LOCKED:
*status = 0;
| FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK;
break;
default:
- printk(KERN_ERR "Lock state unknown %d\n", lock_status);
+ pr_err("Lock state unknown %d\n", lock_status);
}
return 0;
result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
if (result != 0) {
- printk(KERN_ERR "drx39xxj: could not get ber!\n");
+ pr_err("drx39xxj: could not get ber!\n");
*ber = 0;
return 0;
}
result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
if (result != 0) {
- printk(KERN_ERR "drx39xxj: could not get signal strength!\n");
+ pr_err("drx39xxj: could not get signal strength!\n");
*strength = 0;
return 0;
}
result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
if (result != 0) {
- printk(KERN_ERR "drx39xxj: could not read snr!\n");
+ pr_err("drx39xxj: could not read snr!\n");
*snr = 0;
return 0;
}
result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
if (result != 0) {
- printk(KERN_ERR "drx39xxj: could not get uc blocks!\n");
+ pr_err("drx39xxj: could not get uc blocks!\n");
*ucblocks = 0;
return 0;
}
/* Set the standard (will be powered up if necessary */
result = drx_ctrl(demod, DRX_CTRL_SET_STANDARD, &standard);
if (result != 0) {
- printk(KERN_ERR "Failed to set standard! result=%02x\n",
+ pr_err("Failed to set standard! result=%02x\n",
result);
return -EINVAL;
}
/* program channel */
result = drx_ctrl(demod, DRX_CTRL_SET_CHANNEL, &channel);
if (result != 0) {
- printk(KERN_ERR "Failed to set channel!\n");
+ pr_err("Failed to set channel!\n");
return -EINVAL;
}
/* Just for giggles, let's shut off the LNA again.... */
uio_data.value = false;
result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data);
if (result != 0) {
- printk(KERN_ERR "Failed to disable LNA!\n");
+ pr_err("Failed to disable LNA!\n");
return 0;
}
#ifdef DJH_DEBUG
for (i = 0; i < 2000; i++) {
fe_status_t 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);
i += 100;
}
int result;
#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);
#endif
result = drx_ctrl(demod, DRX_CTRL_I2C_BRIDGE, &i2c_gate_state);
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);
dump_stack();
} else {
result = drx_open(demod);
if (result != 0) {
- printk(KERN_ERR "DRX open failed! Aborting\n");
+ pr_err("DRX open failed! Aborting\n");
kfree(state);
return NULL;
}
/* Configure user-I/O #3: enable read/write */
result = drx_ctrl(demod, DRX_CTRL_UIO_CFG, &uio_cfg);
if (result != 0) {
- printk(KERN_ERR "Failed to setup LNA GPIO!\n");
+ pr_err("Failed to setup LNA GPIO!\n");
return NULL;
}
uio_data.value = false;
result = drx_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data);
if (result != 0) {
- printk(KERN_ERR "Failed to disable LNA!\n");
+ pr_err("Failed to disable LNA!\n");
return NULL;
}
+#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
+
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
}
if (state->i2c == NULL) {
- printk("i2c was zero, aborting\n");
+ pr_err("i2c was zero, aborting\n");
return 0;
}
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;
}
.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);
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;
}
#endif