Re: idea on how to break the static dependencies on demodulator modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 04, 2006, Andrew de Quincey wrote:
> Hi, did anyone have any comments on the latest version at 
> http://linuxtv.org/hg/~quincy/v4l-dvb-attach
> 
> This used module reference counts instead of symbol reference counts, avoiding 
> the problems with symbol_put().

First, I would like it better if symbol_put_addr() would be fixed
so we could use my dvb_detach() idea ;-)
It would mean that no changes to the frontend drivers are
necessary at all.

Anyway, quoting your patch:

> #define dvb_attach(FUNCTION, ARGS...) ({ \
> 	void *__r = NULL; \
> 	typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
> 	if (__a) { \
> 		__r = __a(THIS_MODULE, ARGS); \
> 		symbol_put(FUNCTION); \
> 	} else printk(KERN_ERR "DVB: Unable to get function "#FUNCTION"()\n"); \
> 	__r; \
> })
...
> struct dvb_frontend* stv0299_attach(struct module *owner,
...
> 	state->owner = owner;
>	if (owner)
>		try_module_get(owner);

Doesn't this drop the refcount to the frontend module, and
raise the refcount to the card driver? I.e. the  frontend
module can be unloaded while it is in use?


Johannes

_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux