All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency
@ 2011-06-01  9:45 Bjørn Mork
  2011-06-01  9:49 ` Antti Palosaari
  0 siblings, 1 reply; 9+ messages in thread
From: Bjørn Mork @ 2011-06-01  9:45 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Steve Kerrison, linux-media

Hello,

I noticed this warning 

    WARNING: "cxd2820r_get_tuner_i2c_adapter" [/usr/local/src/git/linux-2.6/drivers/media/video/em28xx/em28xx-dvb.ko] undefined!

while building the driver in 2.6.32 with backported 290e support.  This
warning does not appear with 3.0.0-rc1, but the call still does cause a
hard dependency on cxd2820r even if you build with CONFIG_MEDIA_ATTACH=y:

bjorn@canardo:/usr/local/src/git/linux-2.6$ modinfo drivers/media/video/em28xx/em28xx-dvb.ko
filename:       drivers/media/video/em28xx/em28xx-dvb.ko
license:        GPL
author:         Mauro Carvalho Chehab <mchehab@infradead.org>
description:    driver for em28xx based DVB cards
depends:        cxd2820r,dvb-core,em28xx,usbcore
vermagic:       3.0.0-rc1+ SMP mod_unload modversions 
parm:           debug:enable debug messages [dvb] (int)
parm:           adapter_nr:DVB adapter numbers (array of short)

I assume this is unwanted.  As you can see, cxd2820r is the only
frontend dependency....

Don't know the proper fix.  My naïve quick-fix was just to move struct
cxd2820r_priv into cxd2820r.h and making the function static inlined.
However, I do see that you may not want the struct in cxd2820r.h.  But I
trust that you have a brilliant solution to the problem :-)

Thanks for your great work on the cxd2820r driver and nanostick T2 290e
support!



Bjørn

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency
  2011-06-01  9:45 [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency Bjørn Mork
@ 2011-06-01  9:49 ` Antti Palosaari
  2011-06-01 10:31   ` Bjørn Mork
  2011-06-01 10:53   ` Bjørn Mork
  0 siblings, 2 replies; 9+ messages in thread
From: Antti Palosaari @ 2011-06-01  9:49 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: Steve Kerrison, linux-media

On 06/01/2011 12:45 PM, Bjørn Mork wrote:
> Don't know the proper fix.  My naïve quick-fix was just to move struct
> cxd2820r_priv into cxd2820r.h and making the function static inlined.
> However, I do see that you may not want the struct in cxd2820r.h.  But I
> trust that you have a brilliant solution to the problem :-)

Actually I don't have any idea about that. Help is welcome.

regards
Antti

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency
  2011-06-01  9:49 ` Antti Palosaari
@ 2011-06-01 10:31   ` Bjørn Mork
  2011-06-01 10:53   ` Bjørn Mork
  1 sibling, 0 replies; 9+ messages in thread
From: Bjørn Mork @ 2011-06-01 10:31 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 921 bytes --]

Antti Palosaari <crope@iki.fi> writes:
> On 06/01/2011 12:45 PM, Bjørn Mork wrote:
>> Don't know the proper fix.  My naïve quick-fix was just to move struct
>> cxd2820r_priv into cxd2820r.h and making the function static inlined.
>> However, I do see that you may not want the struct in cxd2820r.h.  But I
>> trust that you have a brilliant solution to the problem :-)
>
> Actually I don't have any idea about that. Help is welcome.

Well, my straight forward approach is attached if you find that useful.
I removed the whole function call, since it was only ever called from
one place.  But that is your call.

I assume the fancy solution involves symbol trickery ala what
dvb_attach() does.  You do of course know that the symbol is available
at the point where em28xx-dvb calls it, as the cxd2820r_attach() must
have succeeded.  So "all" you need to do is to prevent the module tools
from being too smart.


Bjørn


[-- Attachment #2: 0001-em28xx-dvb-avoid-unwanted-dependency-on-cxd2820r.patch --]
[-- Type: text/x-diff, Size: 4469 bytes --]

>From 857331b809fca1003056dbc0f01f917e792981db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
Date: Tue, 31 May 2011 15:16:39 +0200
Subject: [PATCH] em28xx-dvb: avoid unwanted dependency on cxd2820r
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Calling cxd2820r_get_tuner_i2c_adapter() creates a dependency on cxd2820r
even if CONFIG_MEDIA_ATTACH is set.  Avoid this

Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
 drivers/media/dvb/frontends/cxd2820r.h      |   27 +++++++++++++++++----------
 drivers/media/dvb/frontends/cxd2820r_core.c |    7 -------
 drivers/media/dvb/frontends/cxd2820r_priv.h |   18 ------------------
 drivers/media/video/em28xx/em28xx-dvb.c     |    4 ++--
 4 files changed, 19 insertions(+), 37 deletions(-)

diff --git a/drivers/media/dvb/frontends/cxd2820r.h b/drivers/media/dvb/frontends/cxd2820r.h
index ad17845..e0eeea8 100644
--- a/drivers/media/dvb/frontends/cxd2820r.h
+++ b/drivers/media/dvb/frontends/cxd2820r.h
@@ -85,6 +85,23 @@ struct cxd2820r_config {
 	u8 gpio_dvbc[3];
 };
 
+struct cxd2820r_priv {
+	struct i2c_adapter *i2c;
+	struct dvb_frontend fe[2];
+	struct cxd2820r_config cfg;
+	struct i2c_adapter tuner_i2c_adapter;
+
+	struct mutex fe_lock; /* FE lock */
+	int active_fe:2; /* FE lock, -1=NONE, 0=DVB-T/T2, 1=DVB-C */
+
+	int ber_running:1;
+
+	u8 bank[2];
+	u8 gpio[3];
+
+	fe_delivery_system_t delivery_system;
+	int last_tune_failed:1; /* for switch between T and T2 tune */
+};
 
 #if defined(CONFIG_DVB_CXD2820R) || \
 	(defined(CONFIG_DVB_CXD2820R_MODULE) && defined(MODULE))
@@ -93,9 +110,6 @@ extern struct dvb_frontend *cxd2820r_attach(
 	struct i2c_adapter *i2c,
 	struct dvb_frontend *fe
 );
-extern struct i2c_adapter *cxd2820r_get_tuner_i2c_adapter(
-	struct dvb_frontend *fe
-);
 #else
 static inline struct dvb_frontend *cxd2820r_attach(
 	const struct cxd2820r_config *config,
@@ -106,13 +120,6 @@ static inline struct dvb_frontend *cxd2820r_attach(
 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
 	return NULL;
 }
-static inline struct i2c_adapter *cxd2820r_get_tuner_i2c_adapter(
-	struct dvb_frontend *fe
-)
-{
-	return NULL;
-}
-
 #endif
 
 #endif /* CXD2820R_H */
diff --git a/drivers/media/dvb/frontends/cxd2820r_core.c b/drivers/media/dvb/frontends/cxd2820r_core.c
index 0779f69..48e0265 100644
--- a/drivers/media/dvb/frontends/cxd2820r_core.c
+++ b/drivers/media/dvb/frontends/cxd2820r_core.c
@@ -771,13 +771,6 @@ static struct i2c_algorithm cxd2820r_tuner_i2c_algo = {
 	.functionality = cxd2820r_tuner_i2c_func,
 };
 
-struct i2c_adapter *cxd2820r_get_tuner_i2c_adapter(struct dvb_frontend *fe)
-{
-	struct cxd2820r_priv *priv = fe->demodulator_priv;
-	return &priv->tuner_i2c_adapter;
-}
-EXPORT_SYMBOL(cxd2820r_get_tuner_i2c_adapter);
-
 static struct dvb_frontend_ops cxd2820r_ops[2];
 
 struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
diff --git a/drivers/media/dvb/frontends/cxd2820r_priv.h b/drivers/media/dvb/frontends/cxd2820r_priv.h
index 25adbee..5adeccd 100644
--- a/drivers/media/dvb/frontends/cxd2820r_priv.h
+++ b/drivers/media/dvb/frontends/cxd2820r_priv.h
@@ -46,24 +46,6 @@ struct reg_val_mask {
 	u8  mask;
 };
 
-struct cxd2820r_priv {
-	struct i2c_adapter *i2c;
-	struct dvb_frontend fe[2];
-	struct cxd2820r_config cfg;
-	struct i2c_adapter tuner_i2c_adapter;
-
-	struct mutex fe_lock; /* FE lock */
-	int active_fe:2; /* FE lock, -1=NONE, 0=DVB-T/T2, 1=DVB-C */
-
-	int ber_running:1;
-
-	u8 bank[2];
-	u8 gpio[3];
-
-	fe_delivery_system_t delivery_system;
-	int last_tune_failed:1; /* for switch between T and T2 tune */
-};
-
 /* cxd2820r_core.c */
 
 extern int cxd2820r_debug;
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index 7904ca4..e723c61 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -668,8 +668,8 @@ static int dvb_init(struct em28xx *dev)
 		dvb->fe[0] = dvb_attach(cxd2820r_attach,
 			&em28xx_cxd2820r_config, &dev->i2c_adap, NULL);
 		if (dvb->fe[0]) {
-			struct i2c_adapter *i2c_tuner;
-			i2c_tuner = cxd2820r_get_tuner_i2c_adapter(dvb->fe[0]);
+			struct cxd2820r_priv *priv = dvb->fe[0]->demodulator_priv;
+			struct i2c_adapter *i2c_tuner = &priv->tuner_i2c_adapter;
 			/* FE 0 attach tuner */
 			if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60,
 				i2c_tuner, &em28xx_cxd2820r_tda18271_config)) {
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency
  2011-06-01  9:49 ` Antti Palosaari
  2011-06-01 10:31   ` Bjørn Mork
@ 2011-06-01 10:53   ` Bjørn Mork
  2011-06-01 17:18     ` Bjørn Mork
  1 sibling, 1 reply; 9+ messages in thread
From: Bjørn Mork @ 2011-06-01 10:53 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Steve Kerrison, linux-media

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

Another possible solution...  This is my last one, I promise :-)

I looked at dvb_attach() and realized that you can ab^H^Hreuse it.  This
makes the patch tiny, and allow you to continue hiding 
struct cxd2820r_priv.


Bjørn



[-- Attachment #2: 0001-em28xx-dvb-Use-dvb_attach-to-call-cxd2820r_get_tuner.patch --]
[-- Type: text/x-diff, Size: 1461 bytes --]

>From b570bbad12c1d164ed92c6711a1775db29c4c0a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
Date: Wed, 1 Jun 2011 12:48:25 +0200
Subject: [PATCH] em28xx-dvb: Use dvb_attach to call cxd2820r_get_tuner_i2c_adapter()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This avoids a hard module dependency on cxd2820r.  Even though we
don't really attach anything in this call, we can stil reuse
dvb_attach since the called function is expected to return a
pointer.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
 drivers/media/video/em28xx/em28xx-dvb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index 7904ca4..d994592 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -669,7 +669,8 @@ static int dvb_init(struct em28xx *dev)
 			&em28xx_cxd2820r_config, &dev->i2c_adap, NULL);
 		if (dvb->fe[0]) {
 			struct i2c_adapter *i2c_tuner;
-			i2c_tuner = cxd2820r_get_tuner_i2c_adapter(dvb->fe[0]);
+			/* we don't really attach i2c_tuner.  Just reusing the symbol logic */
+			i2c_tuner = dvb_attach(cxd2820r_get_tuner_i2c_adapter, dvb->fe[0]);
 			/* FE 0 attach tuner */
 			if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60,
 				i2c_tuner, &em28xx_cxd2820r_tda18271_config)) {
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency
  2011-06-01 10:53   ` Bjørn Mork
@ 2011-06-01 17:18     ` Bjørn Mork
  2011-06-03 12:21       ` Antti Palosaari
  0 siblings, 1 reply; 9+ messages in thread
From: Bjørn Mork @ 2011-06-01 17:18 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Steve Kerrison, linux-media

Bjørn Mork <bjorn@mork.no> writes:

> diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
> index 7904ca4..d994592 100644
> --- a/drivers/media/video/em28xx/em28xx-dvb.c
> +++ b/drivers/media/video/em28xx/em28xx-dvb.c
> @@ -669,7 +669,8 @@ static int dvb_init(struct em28xx *dev)
>  			&em28xx_cxd2820r_config, &dev->i2c_adap, NULL);
>  		if (dvb->fe[0]) {
>  			struct i2c_adapter *i2c_tuner;
> -			i2c_tuner = cxd2820r_get_tuner_i2c_adapter(dvb->fe[0]);
> +			/* we don't really attach i2c_tuner.  Just reusing the symbol logic */
> +			i2c_tuner = dvb_attach(cxd2820r_get_tuner_i2c_adapter, dvb->fe[0]);

Except that this really messes up the reference count, and need to have
a matching symbol_put...  So you should probably code it with
symbol_request()/symbol_put() if you want to go this way instead of
the dvb_attach shortcut .


Bjørn 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency
  2011-06-01 17:18     ` Bjørn Mork
@ 2011-06-03 12:21       ` Antti Palosaari
  2011-06-03 12:50         ` Bjørn Mork
  0 siblings, 1 reply; 9+ messages in thread
From: Antti Palosaari @ 2011-06-03 12:21 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: Steve Kerrison, linux-media

On 06/01/2011 08:18 PM, Bjørn Mork wrote:
> Bjørn Mork<bjorn@mork.no>  writes:
>
>> diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
>> index 7904ca4..d994592 100644
>> --- a/drivers/media/video/em28xx/em28xx-dvb.c
>> +++ b/drivers/media/video/em28xx/em28xx-dvb.c
>> @@ -669,7 +669,8 @@ static int dvb_init(struct em28xx *dev)
>>   			&em28xx_cxd2820r_config,&dev->i2c_adap, NULL);
>>   		if (dvb->fe[0]) {
>>   			struct i2c_adapter *i2c_tuner;
>> -			i2c_tuner = cxd2820r_get_tuner_i2c_adapter(dvb->fe[0]);
>> +			/* we don't really attach i2c_tuner.  Just reusing the symbol logic */
>> +			i2c_tuner = dvb_attach(cxd2820r_get_tuner_i2c_adapter, dvb->fe[0]);
>
> Except that this really messes up the reference count, and need to have
> a matching symbol_put...  So you should probably code it with
> symbol_request()/symbol_put() if you want to go this way instead of
> the dvb_attach shortcut .


There is some other FEs having also I2C adapter, I wonder how those 
handle this situation. I looked example from cx24123 and s5h1420 
drivers, both used by flexcop.

Did you see what is magic used those devices?


best regards,
Antti
-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency
  2011-06-03 12:21       ` Antti Palosaari
@ 2011-06-03 12:50         ` Bjørn Mork
  2011-06-03 12:59           ` Antti Palosaari
  0 siblings, 1 reply; 9+ messages in thread
From: Bjørn Mork @ 2011-06-03 12:50 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Steve Kerrison, linux-media

Antti Palosaari <crope@iki.fi> writes:

> There is some other FEs having also I2C adapter, I wonder how those
> handle this situation. I looked example from cx24123 and s5h1420
> drivers, both used by flexcop.
>
> Did you see what is magic used those devices?

None.  They have the same problem, creating hard module dependencies
even if they use dvb_attach() and CONFIG_MEDIA_ATTACH is set:

bjorn@canardo:~$ modinfo b2c2-flexcop
filename:       /lib/modules/2.6.32-5-amd64/kernel/drivers/media/dvb/b2c2/b2c2-flexcop.ko
license:        GPL
description:    B2C2 FlexcopII/II(b)/III digital TV receiver chip
author:         Patrick Boettcher <patrick.boettcher@desy.de
depends:        s5h1420,dvb-core,cx24113,cx24123,i2c-core
vermagic:       2.6.32-5-amd64 SMP mod_unload modversions 
parm:           debug:set debug level (1=info,2=tuner,4=i2c,8=ts,16=sram,32=reg (|-able)). (debugging is not enabled) (int)
parm:           adapter_nr:DVB adapter numbers (array of short)



This probably means that a generic i2c_tuner wrapper, similar to
dvb_attach, would be useful.



Bjørn

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency
  2011-06-03 12:50         ` Bjørn Mork
@ 2011-06-03 12:59           ` Antti Palosaari
  2011-06-03 13:20             ` Bjørn Mork
  0 siblings, 1 reply; 9+ messages in thread
From: Antti Palosaari @ 2011-06-03 12:59 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: Steve Kerrison, linux-media

On 06/03/2011 03:50 PM, Bjørn Mork wrote:
> Antti Palosaari<crope@iki.fi>  writes:
>
>> There is some other FEs having also I2C adapter, I wonder how those
>> handle this situation. I looked example from cx24123 and s5h1420
>> drivers, both used by flexcop.
>>
>> Did you see what is magic used those devices?
>
> None.  They have the same problem, creating hard module dependencies
> even if they use dvb_attach() and CONFIG_MEDIA_ATTACH is set:
>
> bjorn@canardo:~$ modinfo b2c2-flexcop
> filename:       /lib/modules/2.6.32-5-amd64/kernel/drivers/media/dvb/b2c2/b2c2-flexcop.ko
> license:        GPL
> description:    B2C2 FlexcopII/II(b)/III digital TV receiver chip
> author:         Patrick Boettcher<patrick.boettcher@desy.de
> depends:        s5h1420,dvb-core,cx24113,cx24123,i2c-core
> vermagic:       2.6.32-5-amd64 SMP mod_unload modversions
> parm:           debug:set debug level (1=info,2=tuner,4=i2c,8=ts,16=sram,32=reg (|-able)). (debugging is not enabled) (int)
> parm:           adapter_nr:DVB adapter numbers (array of short)
>
>
>
> This probably means that a generic i2c_tuner wrapper, similar to
> dvb_attach, would be useful.

For the cxd2820r it is also possible to return I2C adapter as pointer 
from dvb_attach like pointer to FE0 is carried for FE1 dvb_attach. What 
you think about that?

regards,
Antti

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency
  2011-06-03 12:59           ` Antti Palosaari
@ 2011-06-03 13:20             ` Bjørn Mork
  0 siblings, 0 replies; 9+ messages in thread
From: Bjørn Mork @ 2011-06-03 13:20 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Steve Kerrison, linux-media

Antti Palosaari <crope@iki.fi> writes:
> On 06/03/2011 03:50 PM, Bjørn Mork wrote:
>
>> This probably means that a generic i2c_tuner wrapper, similar to
>> dvb_attach, would be useful.
>
> For the cxd2820r it is also possible to return I2C adapter as pointer
> from dvb_attach like pointer to FE0 is carried for FE1
> dvb_attach. What you think about that?

I don't feel competent to answer that at all.  It does seem like
overloading an existing interface, but it might be OK.

I just grepped a bit around for EXPORT_SYMBOL of anything except
foo_attach, and found that there are a few frontend drivers which
exports multiple symbols:

bjorn@canardo:/usr/local/src/git/linux-2.6$ grep EXPORT_SYMBOL drivers/media/dvb/frontends/*.c|grep -v _attach
drivers/media/dvb/frontends/cx24113.c:EXPORT_SYMBOL(cx24113_agc_callback);
drivers/media/dvb/frontends/cx24123.c:EXPORT_SYMBOL(cx24123_get_tuner_i2c_adapter);
drivers/media/dvb/frontends/cxd2820r_core.c:EXPORT_SYMBOL(cxd2820r_get_tuner_i2c_adapter);
drivers/media/dvb/frontends/dib0070.c:EXPORT_SYMBOL(dib0070_ctrl_agc_filter);
drivers/media/dvb/frontends/dib0070.c:EXPORT_SYMBOL(dib0070_get_rf_output);
drivers/media/dvb/frontends/dib0070.c:EXPORT_SYMBOL(dib0070_set_rf_output);
drivers/media/dvb/frontends/dib0070.c:EXPORT_SYMBOL(dib0070_wbd_offset);
drivers/media/dvb/frontends/dib0090.c:EXPORT_SYMBOL(dib0090_dcc_freq);
drivers/media/dvb/frontends/dib0090.c:EXPORT_SYMBOL(dib0090_pwm_gain_reset);
drivers/media/dvb/frontends/dib0090.c:EXPORT_SYMBOL(dib0090_gain_control);
drivers/media/dvb/frontends/dib0090.c:EXPORT_SYMBOL(dib0090_get_current_gain);
drivers/media/dvb/frontends/dib0090.c:EXPORT_SYMBOL(dib0090_get_wbd_offset);
drivers/media/dvb/frontends/dib0090.c:EXPORT_SYMBOL(dib0090_get_tune_state);
drivers/media/dvb/frontends/dib0090.c:EXPORT_SYMBOL(dib0090_set_tune_state);
drivers/media/dvb/frontends/dib0090.c:EXPORT_SYMBOL(dib0090_register);
drivers/media/dvb/frontends/dib0090.c:EXPORT_SYMBOL(dib0090_fw_register);
drivers/media/dvb/frontends/dib3000mc.c:EXPORT_SYMBOL(dib3000mc_get_tuner_i2c_master);
drivers/media/dvb/frontends/dib3000mc.c:EXPORT_SYMBOL(dib3000mc_pid_control);
drivers/media/dvb/frontends/dib3000mc.c:EXPORT_SYMBOL(dib3000mc_pid_parse);
drivers/media/dvb/frontends/dib3000mc.c:EXPORT_SYMBOL(dib3000mc_set_config);
drivers/media/dvb/frontends/dib3000mc.c:EXPORT_SYMBOL(dib3000mc_i2c_enumeration);
drivers/media/dvb/frontends/dib7000m.c:EXPORT_SYMBOL(dib7000m_get_i2c_master);
drivers/media/dvb/frontends/dib7000m.c:EXPORT_SYMBOL(dib7000m_pid_filter_ctrl);
drivers/media/dvb/frontends/dib7000m.c:EXPORT_SYMBOL(dib7000m_pid_filter);
drivers/media/dvb/frontends/dib7000m.c:EXPORT_SYMBOL(dib7000m_i2c_enumeration);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7000p_set_wbd_ref);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7000p_update_pll);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7000p_set_gpio);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7000p_ctrl_timf);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7000pc_detection);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7000p_get_i2c_master);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7000p_pid_filter_ctrl);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7000p_pid_filter);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7000p_i2c_enumeration);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7090_get_i2c_tuner);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7090_tuner_sleep);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7090_agc_restart);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7090_get_adc_power);
drivers/media/dvb/frontends/dib7000p.c:EXPORT_SYMBOL(dib7090_slave_reset);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_set_wbd_ref);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_set_gpio);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_pwm_agc_reset);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_get_adc_power);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_get_tune_state);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_set_tune_state);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_set_slave_frontend);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_remove_slave_frontend);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_get_slave_frontend);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_i2c_enumeration);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_get_i2c_master);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_pid_filter_ctrl);
drivers/media/dvb/frontends/dib8000.c:EXPORT_SYMBOL(dib8000_pid_filter);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_fw_set_component_bus_speed);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_get_tuner_interface);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_get_component_bus_interface);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_get_i2c_master);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_set_i2c_adapter);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_set_gpio);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_fw_pid_filter_ctrl);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_fw_pid_filter);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_firmware_post_pll_init);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_i2c_enumeration);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_set_slave_frontend);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_remove_slave_frontend);
drivers/media/dvb/frontends/dib9000.c:EXPORT_SYMBOL(dib9000_get_slave_frontend);
drivers/media/dvb/frontends/dibx000_common.c:EXPORT_SYMBOL(dibx000_i2c_set_speed);
drivers/media/dvb/frontends/dibx000_common.c:EXPORT_SYMBOL(dibx000_get_i2c_adapter);
drivers/media/dvb/frontends/dibx000_common.c:EXPORT_SYMBOL(dibx000_reset_i2c_master);
drivers/media/dvb/frontends/dibx000_common.c:EXPORT_SYMBOL(dibx000_init_i2c_master);
drivers/media/dvb/frontends/dibx000_common.c:EXPORT_SYMBOL(dibx000_exit_i2c_master);
drivers/media/dvb/frontends/dibx000_common.c:EXPORT_SYMBOL(systime);
drivers/media/dvb/frontends/drxd_hard.c:EXPORT_SYMBOL(drxd_config_i2c);
drivers/media/dvb/frontends/s5h1420.c:EXPORT_SYMBOL(s5h1420_get_tuner_i2c_adapter);
drivers/media/dvb/frontends/stv090x.c:EXPORT_SYMBOL(stv090x_set_gpio);


Which does show up as hard dependencies on your typical Debian
installation (which does set CONFIG_MEDIA_ATTACH):

 bjorn@nemi:~$ modinfo -F depends dvb-usb-dib0700
 dib8000,dvb-usb,i2c-core,dib0070,dib3000mc,usbcore,dib7000p,dib7000m


So it looks like this problem is much more widespread than I initially
thought, and it may therefore be perfectly OK to do what you did.
However, the em28xx-dvb driver can be used with a large number of
frontends and we certainly don't want them all as hard dependencies.


I think it's time for someone with authority to state what is acceptable
and what is not, with regard to frontends, tuners, dvb_attach(),
EXPORT_SYMBOL and CONFIG_MEDIA_ATTACH. 

For all I know, this may already be documented somewhere.  If so, please
point me there.



Bjørn

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-06-03 13:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01  9:45 [bug-report] unconditionally calling cxd2820r_get_tuner_i2c_adapter() from em28xx-dvb.c creates a hard module dependency Bjørn Mork
2011-06-01  9:49 ` Antti Palosaari
2011-06-01 10:31   ` Bjørn Mork
2011-06-01 10:53   ` Bjørn Mork
2011-06-01 17:18     ` Bjørn Mork
2011-06-03 12:21       ` Antti Palosaari
2011-06-03 12:50         ` Bjørn Mork
2011-06-03 12:59           ` Antti Palosaari
2011-06-03 13:20             ` Bjørn Mork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.