V4L/DVB (4387): Add Kconfig infrastructure for dvb_attach

Allow it to be en/disabled
Disable it in < 2.6.17 due to symbol_xxx() bug

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
diff --git a/drivers/media/dvb/frontends/cx24110.h b/drivers/media/dvb/frontends/cx24110.h
index 9c2b76e..c9d5ae2 100644
--- a/drivers/media/dvb/frontends/cx24110.h
+++ b/drivers/media/dvb/frontends/cx24110.h
@@ -33,9 +33,6 @@
 	u8 demod_address;
 };
 
-extern struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
-					   struct i2c_adapter* i2c);
-
 static inline int cx24110_pll_write(struct dvb_frontend *fe, u32 val) {
 	int r = 0;
 	u8 buf[] = {(u8) (val>>24), (u8) (val>>16), (u8) (val>>8)};
@@ -44,4 +41,16 @@
 	return r;
 }
 
+#if defined(CONFIG_DVB_CX24110) || defined(CONFIG_DVB_CX24110_MODULE)
+extern struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
+					   struct i2c_adapter* i2c);
+#else
+static inline struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
+						  struct i2c_adapter* i2c)
+{
+	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
+	return NULL;
+}
+#endif // CONFIG_DVB_CX24110
+
 #endif // CX24110_H