[media] dib3000mb: use pr_foo() instead of printk()

The dprintk() macro relies on continuation lines. This is not
a good practice and will break after commit 563873318d
("Merge branch 'printk-cleanups'").

So, instead of directly calling printk(), use pr_foo() macros,
adding a \n leading char on each macro call.

The frontend settings also rely on continuation lines. Change
it to avoid the need of adding pr_cont() calls.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Mauro Carvalho Chehab 2016-10-14 08:44:10 -03:00
parent 4bd1a8ddad
commit 585e3227ec
2 changed files with 71 additions and 82 deletions

View file

@ -21,6 +21,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
@ -126,103 +128,96 @@ static int dib3000mb_set_frontend(struct dvb_frontend *fe, int tuner)
fe->ops.tuner_ops.set_params(fe); fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
deb_setf("bandwidth: ");
switch (c->bandwidth_hz) { switch (c->bandwidth_hz) {
case 8000000: case 8000000:
deb_setf("8 MHz\n");
wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[2]); wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[2]);
wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_8mhz); wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_8mhz);
break; break;
case 7000000: case 7000000:
deb_setf("7 MHz\n");
wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[1]); wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[1]);
wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_7mhz); wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_7mhz);
break; break;
case 6000000: case 6000000:
deb_setf("6 MHz\n");
wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[0]); wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[0]);
wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_6mhz); wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_6mhz);
break; break;
case 0: case 0:
return -EOPNOTSUPP; return -EOPNOTSUPP;
default: default:
err("unknown bandwidth value."); pr_err("unknown bandwidth value.\n");
return -EINVAL; return -EINVAL;
} }
deb_setf("bandwidth: %d MHZ\n", c->bandwidth_hz / 1000000);
} }
wr(DIB3000MB_REG_LOCK1_MASK, DIB3000MB_LOCK1_SEARCH_4); wr(DIB3000MB_REG_LOCK1_MASK, DIB3000MB_LOCK1_SEARCH_4);
deb_setf("transmission mode: ");
switch (c->transmission_mode) { switch (c->transmission_mode) {
case TRANSMISSION_MODE_2K: case TRANSMISSION_MODE_2K:
deb_setf("2k\n"); deb_setf("transmission mode: 2k\n");
wr(DIB3000MB_REG_FFT, DIB3000_TRANSMISSION_MODE_2K); wr(DIB3000MB_REG_FFT, DIB3000_TRANSMISSION_MODE_2K);
break; break;
case TRANSMISSION_MODE_8K: case TRANSMISSION_MODE_8K:
deb_setf("8k\n"); deb_setf("transmission mode: 8k\n");
wr(DIB3000MB_REG_FFT, DIB3000_TRANSMISSION_MODE_8K); wr(DIB3000MB_REG_FFT, DIB3000_TRANSMISSION_MODE_8K);
break; break;
case TRANSMISSION_MODE_AUTO: case TRANSMISSION_MODE_AUTO:
deb_setf("auto\n"); deb_setf("transmission mode: auto\n");
break; break;
default: default:
return -EINVAL; return -EINVAL;
} }
deb_setf("guard: ");
switch (c->guard_interval) { switch (c->guard_interval) {
case GUARD_INTERVAL_1_32: case GUARD_INTERVAL_1_32:
deb_setf("1_32\n"); deb_setf("guard 1_32\n");
wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_32); wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_32);
break; break;
case GUARD_INTERVAL_1_16: case GUARD_INTERVAL_1_16:
deb_setf("1_16\n"); deb_setf("guard 1_16\n");
wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_16); wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_16);
break; break;
case GUARD_INTERVAL_1_8: case GUARD_INTERVAL_1_8:
deb_setf("1_8\n"); deb_setf("guard 1_8\n");
wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_8); wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_8);
break; break;
case GUARD_INTERVAL_1_4: case GUARD_INTERVAL_1_4:
deb_setf("1_4\n"); deb_setf("guard 1_4\n");
wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_4); wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_4);
break; break;
case GUARD_INTERVAL_AUTO: case GUARD_INTERVAL_AUTO:
deb_setf("auto\n"); deb_setf("guard auto\n");
break; break;
default: default:
return -EINVAL; return -EINVAL;
} }
deb_setf("inversion: ");
switch (c->inversion) { switch (c->inversion) {
case INVERSION_OFF: case INVERSION_OFF:
deb_setf("off\n"); deb_setf("inversion off\n");
wr(DIB3000MB_REG_DDS_INV, DIB3000_DDS_INVERSION_OFF); wr(DIB3000MB_REG_DDS_INV, DIB3000_DDS_INVERSION_OFF);
break; break;
case INVERSION_AUTO: case INVERSION_AUTO:
deb_setf("auto "); deb_setf("inversion auto\n");
break; break;
case INVERSION_ON: case INVERSION_ON:
deb_setf("on\n"); deb_setf("inversion on\n");
wr(DIB3000MB_REG_DDS_INV, DIB3000_DDS_INVERSION_ON); wr(DIB3000MB_REG_DDS_INV, DIB3000_DDS_INVERSION_ON);
break; break;
default: default:
return -EINVAL; return -EINVAL;
} }
deb_setf("modulation: ");
switch (c->modulation) { switch (c->modulation) {
case QPSK: case QPSK:
deb_setf("qpsk\n"); deb_setf("modulation: qpsk\n");
wr(DIB3000MB_REG_QAM, DIB3000_CONSTELLATION_QPSK); wr(DIB3000MB_REG_QAM, DIB3000_CONSTELLATION_QPSK);
break; break;
case QAM_16: case QAM_16:
deb_setf("qam16\n"); deb_setf("modulation: qam16\n");
wr(DIB3000MB_REG_QAM, DIB3000_CONSTELLATION_16QAM); wr(DIB3000MB_REG_QAM, DIB3000_CONSTELLATION_16QAM);
break; break;
case QAM_64: case QAM_64:
deb_setf("qam64\n"); deb_setf("modulation: qam64\n");
wr(DIB3000MB_REG_QAM, DIB3000_CONSTELLATION_64QAM); wr(DIB3000MB_REG_QAM, DIB3000_CONSTELLATION_64QAM);
break; break;
case QAM_AUTO: case QAM_AUTO:
@ -230,69 +225,64 @@ static int dib3000mb_set_frontend(struct dvb_frontend *fe, int tuner)
default: default:
return -EINVAL; return -EINVAL;
} }
deb_setf("hierarchy: ");
switch (c->hierarchy) { switch (c->hierarchy) {
case HIERARCHY_NONE: case HIERARCHY_NONE:
deb_setf("none "); deb_setf("hierarchy: none\n");
/* fall through */ /* fall through */
case HIERARCHY_1: case HIERARCHY_1:
deb_setf("alpha=1\n"); deb_setf("hierarchy: alpha=1\n");
wr(DIB3000MB_REG_VIT_ALPHA, DIB3000_ALPHA_1); wr(DIB3000MB_REG_VIT_ALPHA, DIB3000_ALPHA_1);
break; break;
case HIERARCHY_2: case HIERARCHY_2:
deb_setf("alpha=2\n"); deb_setf("hierarchy: alpha=2\n");
wr(DIB3000MB_REG_VIT_ALPHA, DIB3000_ALPHA_2); wr(DIB3000MB_REG_VIT_ALPHA, DIB3000_ALPHA_2);
break; break;
case HIERARCHY_4: case HIERARCHY_4:
deb_setf("alpha=4\n"); deb_setf("hierarchy: alpha=4\n");
wr(DIB3000MB_REG_VIT_ALPHA, DIB3000_ALPHA_4); wr(DIB3000MB_REG_VIT_ALPHA, DIB3000_ALPHA_4);
break; break;
case HIERARCHY_AUTO: case HIERARCHY_AUTO:
deb_setf("alpha=auto\n"); deb_setf("hierarchy: alpha=auto\n");
break; break;
default: default:
return -EINVAL; return -EINVAL;
} }
deb_setf("hierarchy: ");
if (c->hierarchy == HIERARCHY_NONE) { if (c->hierarchy == HIERARCHY_NONE) {
deb_setf("none\n");
wr(DIB3000MB_REG_VIT_HRCH, DIB3000_HRCH_OFF); wr(DIB3000MB_REG_VIT_HRCH, DIB3000_HRCH_OFF);
wr(DIB3000MB_REG_VIT_HP, DIB3000_SELECT_HP); wr(DIB3000MB_REG_VIT_HP, DIB3000_SELECT_HP);
fe_cr = c->code_rate_HP; fe_cr = c->code_rate_HP;
} else if (c->hierarchy != HIERARCHY_AUTO) { } else if (c->hierarchy != HIERARCHY_AUTO) {
deb_setf("on\n");
wr(DIB3000MB_REG_VIT_HRCH, DIB3000_HRCH_ON); wr(DIB3000MB_REG_VIT_HRCH, DIB3000_HRCH_ON);
wr(DIB3000MB_REG_VIT_HP, DIB3000_SELECT_LP); wr(DIB3000MB_REG_VIT_HP, DIB3000_SELECT_LP);
fe_cr = c->code_rate_LP; fe_cr = c->code_rate_LP;
} }
deb_setf("fec: ");
switch (fe_cr) { switch (fe_cr) {
case FEC_1_2: case FEC_1_2:
deb_setf("1_2\n"); deb_setf("fec: 1_2\n");
wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_1_2); wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_1_2);
break; break;
case FEC_2_3: case FEC_2_3:
deb_setf("2_3\n"); deb_setf("fec: 2_3\n");
wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_2_3); wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_2_3);
break; break;
case FEC_3_4: case FEC_3_4:
deb_setf("3_4\n"); deb_setf("fec: 3_4\n");
wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_3_4); wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_3_4);
break; break;
case FEC_5_6: case FEC_5_6:
deb_setf("5_6\n"); deb_setf("fec: 5_6\n");
wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_5_6); wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_5_6);
break; break;
case FEC_7_8: case FEC_7_8:
deb_setf("7_8\n"); deb_setf("fec: 7_8\n");
wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_7_8); wr(DIB3000MB_REG_VIT_CODE_RATE, DIB3000_FEC_7_8);
break; break;
case FEC_NONE: case FEC_NONE:
deb_setf("none "); deb_setf("fec: none\n");
break; break;
case FEC_AUTO: case FEC_AUTO:
deb_setf("auto\n"); deb_setf("fec: auto\n");
break; break;
default: default:
return -EINVAL; return -EINVAL;
@ -357,7 +347,8 @@ static int dib3000mb_set_frontend(struct dvb_frontend *fe, int tuner)
rd(DIB3000MB_REG_LOCK2_VALUE))) < 0 && as_count++ < 100) rd(DIB3000MB_REG_LOCK2_VALUE))) < 0 && as_count++ < 100)
msleep(1); msleep(1);
deb_setf("search_state after autosearch %d after %d checks\n",search_state,as_count); deb_setf("search_state after autosearch %d after %d checks\n",
search_state, as_count);
if (search_state == 1) { if (search_state == 1) {
if (dib3000mb_get_frontend(fe, c) == 0) { if (dib3000mb_get_frontend(fe, c) == 0) {
@ -464,7 +455,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
return 0; return 0;
dds_val = ((rd(DIB3000MB_REG_DDS_VALUE_MSB) & 0xff) << 16) + rd(DIB3000MB_REG_DDS_VALUE_LSB); dds_val = ((rd(DIB3000MB_REG_DDS_VALUE_MSB) & 0xff) << 16) + rd(DIB3000MB_REG_DDS_VALUE_LSB);
deb_getf("DDS_VAL: %x %x %x",dds_val, rd(DIB3000MB_REG_DDS_VALUE_MSB), rd(DIB3000MB_REG_DDS_VALUE_LSB)); deb_getf("DDS_VAL: %x %x %x\n", dds_val, rd(DIB3000MB_REG_DDS_VALUE_MSB), rd(DIB3000MB_REG_DDS_VALUE_LSB));
if (dds_val < threshold) if (dds_val < threshold)
inv_test1 = 0; inv_test1 = 0;
else if (dds_val == threshold) else if (dds_val == threshold)
@ -473,7 +464,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
inv_test1 = 2; inv_test1 = 2;
dds_val = ((rd(DIB3000MB_REG_DDS_FREQ_MSB) & 0xff) << 16) + rd(DIB3000MB_REG_DDS_FREQ_LSB); dds_val = ((rd(DIB3000MB_REG_DDS_FREQ_MSB) & 0xff) << 16) + rd(DIB3000MB_REG_DDS_FREQ_LSB);
deb_getf("DDS_FREQ: %x %x %x",dds_val, rd(DIB3000MB_REG_DDS_FREQ_MSB), rd(DIB3000MB_REG_DDS_FREQ_LSB)); deb_getf("DDS_FREQ: %x %x %x\n", dds_val, rd(DIB3000MB_REG_DDS_FREQ_MSB), rd(DIB3000MB_REG_DDS_FREQ_LSB));
if (dds_val < threshold) if (dds_val < threshold)
inv_test2 = 0; inv_test2 = 0;
else if (dds_val == threshold) else if (dds_val == threshold)
@ -490,19 +481,19 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
switch ((tps_val = rd(DIB3000MB_REG_TPS_QAM))) { switch ((tps_val = rd(DIB3000MB_REG_TPS_QAM))) {
case DIB3000_CONSTELLATION_QPSK: case DIB3000_CONSTELLATION_QPSK:
deb_getf("QPSK "); deb_getf("QPSK\n");
c->modulation = QPSK; c->modulation = QPSK;
break; break;
case DIB3000_CONSTELLATION_16QAM: case DIB3000_CONSTELLATION_16QAM:
deb_getf("QAM16 "); deb_getf("QAM16\n");
c->modulation = QAM_16; c->modulation = QAM_16;
break; break;
case DIB3000_CONSTELLATION_64QAM: case DIB3000_CONSTELLATION_64QAM:
deb_getf("QAM64 "); deb_getf("QAM64\n");
c->modulation = QAM_64; c->modulation = QAM_64;
break; break;
default: default:
err("Unexpected constellation returned by TPS (%d)", tps_val); pr_err("Unexpected constellation returned by TPS (%d)\n", tps_val);
break; break;
} }
deb_getf("TPS: %d\n", tps_val); deb_getf("TPS: %d\n", tps_val);
@ -513,23 +504,23 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
c->code_rate_HP = FEC_NONE; c->code_rate_HP = FEC_NONE;
switch ((tps_val = rd(DIB3000MB_REG_TPS_VIT_ALPHA))) { switch ((tps_val = rd(DIB3000MB_REG_TPS_VIT_ALPHA))) {
case DIB3000_ALPHA_0: case DIB3000_ALPHA_0:
deb_getf("HIERARCHY_NONE "); deb_getf("HIERARCHY_NONE\n");
c->hierarchy = HIERARCHY_NONE; c->hierarchy = HIERARCHY_NONE;
break; break;
case DIB3000_ALPHA_1: case DIB3000_ALPHA_1:
deb_getf("HIERARCHY_1 "); deb_getf("HIERARCHY_1\n");
c->hierarchy = HIERARCHY_1; c->hierarchy = HIERARCHY_1;
break; break;
case DIB3000_ALPHA_2: case DIB3000_ALPHA_2:
deb_getf("HIERARCHY_2 "); deb_getf("HIERARCHY_2\n");
c->hierarchy = HIERARCHY_2; c->hierarchy = HIERARCHY_2;
break; break;
case DIB3000_ALPHA_4: case DIB3000_ALPHA_4:
deb_getf("HIERARCHY_4 "); deb_getf("HIERARCHY_4\n");
c->hierarchy = HIERARCHY_4; c->hierarchy = HIERARCHY_4;
break; break;
default: default:
err("Unexpected ALPHA value returned by TPS (%d)", tps_val); pr_err("Unexpected ALPHA value returned by TPS (%d)\n", tps_val);
break; break;
} }
deb_getf("TPS: %d\n", tps_val); deb_getf("TPS: %d\n", tps_val);
@ -546,65 +537,65 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
switch (tps_val) { switch (tps_val) {
case DIB3000_FEC_1_2: case DIB3000_FEC_1_2:
deb_getf("FEC_1_2 "); deb_getf("FEC_1_2\n");
*cr = FEC_1_2; *cr = FEC_1_2;
break; break;
case DIB3000_FEC_2_3: case DIB3000_FEC_2_3:
deb_getf("FEC_2_3 "); deb_getf("FEC_2_3\n");
*cr = FEC_2_3; *cr = FEC_2_3;
break; break;
case DIB3000_FEC_3_4: case DIB3000_FEC_3_4:
deb_getf("FEC_3_4 "); deb_getf("FEC_3_4\n");
*cr = FEC_3_4; *cr = FEC_3_4;
break; break;
case DIB3000_FEC_5_6: case DIB3000_FEC_5_6:
deb_getf("FEC_5_6 "); deb_getf("FEC_5_6\n");
*cr = FEC_4_5; *cr = FEC_4_5;
break; break;
case DIB3000_FEC_7_8: case DIB3000_FEC_7_8:
deb_getf("FEC_7_8 "); deb_getf("FEC_7_8\n");
*cr = FEC_7_8; *cr = FEC_7_8;
break; break;
default: default:
err("Unexpected FEC returned by TPS (%d)", tps_val); pr_err("Unexpected FEC returned by TPS (%d)\n", tps_val);
break; break;
} }
deb_getf("TPS: %d\n",tps_val); deb_getf("TPS: %d\n",tps_val);
switch ((tps_val = rd(DIB3000MB_REG_TPS_GUARD_TIME))) { switch ((tps_val = rd(DIB3000MB_REG_TPS_GUARD_TIME))) {
case DIB3000_GUARD_TIME_1_32: case DIB3000_GUARD_TIME_1_32:
deb_getf("GUARD_INTERVAL_1_32 "); deb_getf("GUARD_INTERVAL_1_32\n");
c->guard_interval = GUARD_INTERVAL_1_32; c->guard_interval = GUARD_INTERVAL_1_32;
break; break;
case DIB3000_GUARD_TIME_1_16: case DIB3000_GUARD_TIME_1_16:
deb_getf("GUARD_INTERVAL_1_16 "); deb_getf("GUARD_INTERVAL_1_16\n");
c->guard_interval = GUARD_INTERVAL_1_16; c->guard_interval = GUARD_INTERVAL_1_16;
break; break;
case DIB3000_GUARD_TIME_1_8: case DIB3000_GUARD_TIME_1_8:
deb_getf("GUARD_INTERVAL_1_8 "); deb_getf("GUARD_INTERVAL_1_8\n");
c->guard_interval = GUARD_INTERVAL_1_8; c->guard_interval = GUARD_INTERVAL_1_8;
break; break;
case DIB3000_GUARD_TIME_1_4: case DIB3000_GUARD_TIME_1_4:
deb_getf("GUARD_INTERVAL_1_4 "); deb_getf("GUARD_INTERVAL_1_4\n");
c->guard_interval = GUARD_INTERVAL_1_4; c->guard_interval = GUARD_INTERVAL_1_4;
break; break;
default: default:
err("Unexpected Guard Time returned by TPS (%d)", tps_val); pr_err("Unexpected Guard Time returned by TPS (%d)\n", tps_val);
break; break;
} }
deb_getf("TPS: %d\n", tps_val); deb_getf("TPS: %d\n", tps_val);
switch ((tps_val = rd(DIB3000MB_REG_TPS_FFT))) { switch ((tps_val = rd(DIB3000MB_REG_TPS_FFT))) {
case DIB3000_TRANSMISSION_MODE_2K: case DIB3000_TRANSMISSION_MODE_2K:
deb_getf("TRANSMISSION_MODE_2K "); deb_getf("TRANSMISSION_MODE_2K\n");
c->transmission_mode = TRANSMISSION_MODE_2K; c->transmission_mode = TRANSMISSION_MODE_2K;
break; break;
case DIB3000_TRANSMISSION_MODE_8K: case DIB3000_TRANSMISSION_MODE_8K:
deb_getf("TRANSMISSION_MODE_8K "); deb_getf("TRANSMISSION_MODE_8K\n");
c->transmission_mode = TRANSMISSION_MODE_8K; c->transmission_mode = TRANSMISSION_MODE_8K;
break; break;
default: default:
err("unexpected transmission mode return by TPS (%d)", tps_val); pr_err("unexpected transmission mode return by TPS (%d)\n", tps_val);
break; break;
} }
deb_getf("TPS: %d\n", tps_val); deb_getf("TPS: %d\n", tps_val);

View file

@ -13,20 +13,15 @@
#ifndef __DIB3000MB_PRIV_H_INCLUDED__ #ifndef __DIB3000MB_PRIV_H_INCLUDED__
#define __DIB3000MB_PRIV_H_INCLUDED__ #define __DIB3000MB_PRIV_H_INCLUDED__
/* info and err, taken from usb.h, if there is anything available like by default. */
#define err(format, arg...) printk(KERN_ERR "dib3000: " format "\n" , ## arg)
#define info(format, arg...) printk(KERN_INFO "dib3000: " format "\n" , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "dib3000: " format "\n" , ## arg)
/* handy shortcuts */ /* handy shortcuts */
#define rd(reg) dib3000_read_reg(state,reg) #define rd(reg) dib3000_read_reg(state,reg)
#define wr(reg,val) if (dib3000_write_reg(state,reg,val)) \ #define wr(reg,val) if (dib3000_write_reg(state,reg,val)) \
{ err("while sending 0x%04x to 0x%04x.",val,reg); return -EREMOTEIO; } { pr_err("while sending 0x%04x to 0x%04x.", val, reg); return -EREMOTEIO; }
#define wr_foreach(a,v) { int i; \ #define wr_foreach(a,v) { int i; \
if (sizeof(a) != sizeof(v)) \ if (sizeof(a) != sizeof(v)) \
err("sizeof: %zu %zu is different",sizeof(a),sizeof(v));\ pr_err("sizeof: %zu %zu is different", sizeof(a), sizeof(v));\
for (i=0; i < sizeof(a)/sizeof(u16); i++) \ for (i=0; i < sizeof(a)/sizeof(u16); i++) \
wr(a[i],v[i]); \ wr(a[i],v[i]); \
} }
@ -37,8 +32,11 @@
/* debug */ /* debug */
#define dprintk(level,args...) \ #define dprintk(level, fmt, arg...) do { \
do { if ((debug & level)) { printk(args); } } while (0) if (debug & level) \
printk(KERN_DEBUG pr_fmt("%s: " fmt), \
__func__, ##arg); \
} while (0)
/* mask for enabling a specific pid for the pid_filter */ /* mask for enabling a specific pid for the pid_filter */
#define DIB3000_ACTIVATE_PID_FILTERING (0x2000) #define DIB3000_ACTIVATE_PID_FILTERING (0x2000)