From 83b2408914b9c02600c8288459ed869037efd1dd Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hselasky@c2i.net>
Date: Mon, 23 May 2011 12:54:21 +0200
Subject: [PATCH] The info and err macros are already defined by the USB stack. Rename these macros to avoid macro redefinition warnings.

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
---
 drivers/media/dvb/frontends/cx24123.c        |   34 +++++++++++++-------------
 drivers/media/dvb/frontends/dib3000mb.c      |   12 ++++----
 drivers/media/dvb/frontends/dib3000mb_priv.h |   10 +++----
 3 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c
index b1dd8ac..b73fb90 100644
--- a/drivers/media/dvb/frontends/cx24123.c
+++ b/drivers/media/dvb/frontends/cx24123.c
@@ -41,8 +41,8 @@ static int debug;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)");
 
-#define info(args...) do { printk(KERN_INFO "CX24123: " args); } while (0)
-#define err(args...)  do { printk(KERN_ERR  "CX24123: " args); } while (0)
+#define cx_info(args...) do { printk(KERN_INFO "CX24123: " args); } while (0)
+#define cx_err(args...)  do { printk(KERN_ERR  "CX24123: " args); } while (0)
 
 #define dprintk(args...) \
 	do { \
@@ -274,7 +274,7 @@ static int cx24123_i2c_readreg(struct cx24123_state *state, u8 i2c_addr, u8 reg)
 	ret = i2c_transfer(state->i2c, msg, 2);
 
 	if (ret != 2) {
-		err("%s: reg=0x%x (error=%d)\n", __func__, reg, ret);
+		cx_err("%s: reg=0x%x (error=%d)\n", __func__, reg, ret);
 		return ret;
 	}
 
@@ -620,7 +620,7 @@ static int cx24123_pll_writereg(struct dvb_frontend *fe,
 	cx24123_writereg(state, 0x22, (data >> 16) & 0xff);
 	while ((cx24123_readreg(state, 0x20) & 0x40) == 0) {
 		if (time_after(jiffies, timeout)) {
-			err("%s:  demodulator is not responding, "\
+			cx_err("%s:  demodulator is not responding, "\
 				"possibly hung, aborting.\n", __func__);
 			return -EREMOTEIO;
 		}
@@ -632,7 +632,7 @@ static int cx24123_pll_writereg(struct dvb_frontend *fe,
 	cx24123_writereg(state, 0x22, (data >> 8) & 0xff);
 	while ((cx24123_readreg(state, 0x20) & 0x40) == 0) {
 		if (time_after(jiffies, timeout)) {
-			err("%s:  demodulator is not responding, "\
+			cx_err("%s:  demodulator is not responding, "\
 				"possibly hung, aborting.\n", __func__);
 			return -EREMOTEIO;
 		}
@@ -645,7 +645,7 @@ static int cx24123_pll_writereg(struct dvb_frontend *fe,
 	cx24123_writereg(state, 0x22, (data) & 0xff);
 	while ((cx24123_readreg(state, 0x20) & 0x80)) {
 		if (time_after(jiffies, timeout)) {
-			err("%s:  demodulator is not responding," \
+			cx_err("%s:  demodulator is not responding," \
 				"possibly hung, aborting.\n", __func__);
 			return -EREMOTEIO;
 		}
@@ -668,7 +668,7 @@ static int cx24123_pll_tune(struct dvb_frontend *fe,
 	dprintk("frequency=%i\n", p->frequency);
 
 	if (cx24123_pll_calculate(fe, p) != 0) {
-		err("%s: cx24123_pll_calcutate failed\n", __func__);
+		cx_err("%s: cx24123_pll_calcutate failed\n", __func__);
 		return -EINVAL;
 	}
 
@@ -765,7 +765,7 @@ static void cx24123_wait_for_diseqc(struct cx24123_state *state)
 	unsigned long timeout = jiffies + msecs_to_jiffies(200);
 	while (!(cx24123_readreg(state, 0x29) & 0x40)) {
 		if (time_after(jiffies, timeout)) {
-			err("%s: diseqc queue not ready, " \
+			cx_err("%s: diseqc queue not ready, " \
 				"command may be lost.\n", __func__);
 			break;
 		}
@@ -947,7 +947,7 @@ static int cx24123_set_frontend(struct dvb_frontend *fe,
 	else if (fe->ops.tuner_ops.set_params)
 		fe->ops.tuner_ops.set_params(fe, p);
 	else
-		err("it seems I don't have a tuner...");
+		cx_err("it seems I don't have a tuner...");
 
 	/* Enable automatic acquisition and reset cycle */
 	cx24123_writereg(state, 0x03, (cx24123_readreg(state, 0x03) | 0x07));
@@ -968,11 +968,11 @@ static int cx24123_get_frontend(struct dvb_frontend *fe,
 	dprintk("\n");
 
 	if (cx24123_get_inversion(state, &p->inversion) != 0) {
-		err("%s: Failed to get inversion status\n", __func__);
+		cx_err("%s: Failed to get inversion status\n", __func__);
 		return -EREMOTEIO;
 	}
 	if (cx24123_get_fec(state, &p->u.qpsk.fec_inner) != 0) {
-		err("%s: Failed to get fec status\n", __func__);
+		cx_err("%s: Failed to get fec status\n", __func__);
 		return -EREMOTEIO;
 	}
 	p->frequency = state->currentfreq;
@@ -999,7 +999,7 @@ static int cx24123_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
 		dprintk("setting tone off\n");
 		return cx24123_writereg(state, 0x29, val & 0xef);
 	default:
-		err("CASE reached default with tone=%d\n", tone);
+		cx_err("CASE reached default with tone=%d\n", tone);
 		return -EINVAL;
 	}
 
@@ -1075,7 +1075,7 @@ struct dvb_frontend *cx24123_attach(const struct cx24123_config *config,
 
 	dprintk("\n");
 	if (state == NULL) {
-		err("Unable to kzalloc\n");
+		cx_err("Unable to kzalloc\n");
 		goto error;
 	}
 
@@ -1087,13 +1087,13 @@ struct dvb_frontend *cx24123_attach(const struct cx24123_config *config,
 	state->demod_rev = cx24123_readreg(state, 0x00);
 	switch (state->demod_rev) {
 	case 0xe1:
-		info("detected CX24123C\n");
+		cx_info("detected CX24123C\n");
 		break;
 	case 0xd1:
-		info("detected CX24123\n");
+		cx_info("detected CX24123\n");
 		break;
 	default:
-		err("wrong demod revision: %x\n", state->demod_rev);
+		cx_err("wrong demod revision: %x\n", state->demod_rev);
 		goto error;
 	}
 
@@ -1112,7 +1112,7 @@ struct dvb_frontend *cx24123_attach(const struct cx24123_config *config,
 	state->tuner_i2c_adapter.algo_data = NULL;
 	i2c_set_adapdata(&state->tuner_i2c_adapter, state);
 	if (i2c_add_adapter(&state->tuner_i2c_adapter) < 0) {
-		err("tuner i2c bus could not be initialized\n");
+		cx_err("tuner i2c bus could not be initialized\n");
 		goto error;
 	}
 
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c
index e80c597..b0a795a 100644
--- a/drivers/media/dvb/frontends/dib3000mb.c
+++ b/drivers/media/dvb/frontends/dib3000mb.c
@@ -147,7 +147,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
 			case BANDWIDTH_AUTO:
 				return -EOPNOTSUPP;
 			default:
-				err("unknown bandwidth value.");
+				dib_err("unknown bandwidth value.");
 				return -EINVAL;
 		}
 	}
@@ -505,7 +505,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 			ofdm->constellation = QAM_64;
 			break;
 		default:
-			err("Unexpected constellation returned by TPS (%d)", tps_val);
+			dib_err("Unexpected constellation returned by TPS (%d)", tps_val);
 			break;
 	}
 	deb_getf("TPS: %d\n", tps_val);
@@ -532,7 +532,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 				ofdm->hierarchy_information = HIERARCHY_4;
 				break;
 			default:
-				err("Unexpected ALPHA value returned by TPS (%d)", tps_val);
+				dib_err("Unexpected ALPHA value returned by TPS (%d)", tps_val);
 				break;
 		}
 		deb_getf("TPS: %d\n", tps_val);
@@ -569,7 +569,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 			*cr = FEC_7_8;
 			break;
 		default:
-			err("Unexpected FEC returned by TPS (%d)", tps_val);
+			dib_err("Unexpected FEC returned by TPS (%d)", tps_val);
 			break;
 	}
 	deb_getf("TPS: %d\n",tps_val);
@@ -592,7 +592,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 			ofdm->guard_interval = GUARD_INTERVAL_1_4;
 			break;
 		default:
-			err("Unexpected Guard Time returned by TPS (%d)", tps_val);
+			dib_err("Unexpected Guard Time returned by TPS (%d)", tps_val);
 			break;
 	}
 	deb_getf("TPS: %d\n", tps_val);
@@ -607,7 +607,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
 			ofdm->transmission_mode = TRANSMISSION_MODE_8K;
 			break;
 		default:
-			err("unexpected transmission mode return by TPS (%d)", tps_val);
+			dib_err("unexpected transmission mode return by TPS (%d)", tps_val);
 			break;
 	}
 	deb_getf("TPS: %d\n", tps_val);
diff --git a/drivers/media/dvb/frontends/dib3000mb_priv.h b/drivers/media/dvb/frontends/dib3000mb_priv.h
index 16c5265..c9c36ce 100644
--- a/drivers/media/dvb/frontends/dib3000mb_priv.h
+++ b/drivers/media/dvb/frontends/dib3000mb_priv.h
@@ -13,20 +13,18 @@
 #ifndef __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)
+/* dib_err - error printout wrapper */
+#define dib_err(format, arg...) printk(KERN_ERR     "dib3000: " format "\n" , ## arg)
 
 /* handy shortcuts */
 #define rd(reg) dib3000_read_reg(state,reg)
 
 #define wr(reg,val) if (dib3000_write_reg(state,reg,val)) \
-	{ err("while sending 0x%04x to 0x%04x.",val,reg); return -EREMOTEIO; }
+	{ dib_err("while sending 0x%04x to 0x%04x.",val,reg); return -EREMOTEIO; }
 
 #define wr_foreach(a,v) { int i; \
 	if (sizeof(a) != sizeof(v)) \
-		err("sizeof: %zu %zu is different",sizeof(a),sizeof(v));\
+		dib_err("sizeof: %zu %zu is different",sizeof(a),sizeof(v));\
 	for (i=0; i < sizeof(a)/sizeof(u16); i++) \
 		wr(a[i],v[i]); \
 	}
-- 
1.7.1.1

