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 Tue, May 16, 2006, Andrew de Quincey wrote:
> In the meantime, I've done a partial version with js's suggestions - it is at 
> 
> http://linuxtv.org/hg/~quincy/v4l-dvb-attach
> 
> This removes chaining, and adds support for the SEC devices into the 
> frontend_ops. I have not implemented any frontend changes yet.

Those two changes:

http://linuxtv.org/hg/~quincy/v4l-dvb-attach?cmd=changeset;node=66280c078abf;style=gitweb
http://linuxtv.org/hg/~quincy/v4l-dvb-attach?cmd=changeset;node=600622e5a61e;style=gitweb

Look good to me, but should be folded into one before
asking Mauro to pull (they are not independent).
Maybe Oliver can ACK.

I think they completely remove the chaining problem.

> Also: there are no symbol_put_addrs() done yet. I've not yet had time to think 
> on how do to do that - any suggestions? We could use a dvb_detach as js 
> suggests, passing it the release() pointer to detach and then call 
> symbol_put_adddr.
...
> Here is a first stab at dvb_detach (sorry if you already posted one johannes; 
> I have zapped the message :(
> 
> #define dvb_detach(FUNCTION, FE) \
> do { \
> 	if (FUNCTION) { \
> 		FUNCTION(FE); \
> 		symbol_put_addr(FUNCTION); \
> 	} \
> } while(0);
> 
> We could either make the card drivers call this directly, or (for convenience) 
> call it from dvb_unregister_frontend() instead of directly calling the 
> release() methods like we do just now

It cannot be called from dvb_unregister_frontend(), as the whole
point of this exercise is that dvb_attach/detach is optional.

So, it must be called by the card drivers, right after
the dvb_unregister_frontend() call, and it should simply do:

#define dvb_detach(function) symbol_put_addr(function)

(As a minor complication, fe->ops.release needs to be
saved in a temporary between dvb_unregister_frontend()
and dvb_detach().)

We should also add a BUG_ON(!fe->ops.release) to
dvb_register_frontend(), and remove the bogus
warning printk from dvb_unregister_frontend().


Or, probably more correct, change dvb_attach() to return
the foo_attach function pointer, and save that in a
new field in the car driver struct, and pass that
to dvb_detach().


Or, maybe we should handle this via Kconfig? So
that you can add the dvb_detach() to dvb_unregister_frontend(),
but one can disable dvb_detach/dvb_detach via
CONFIG_DVB_FRONTEND_STATIC_DEPS?

Vote for your favourite solution...


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