[linux-dvb] idea on how to break the static dependencies on demodulator modules

Trent Piepho xyzzy at speakeasy.org
Thu Apr 27 01:57:41 CEST 2006

On Thu, 27 Apr 2006, Johannes Stezenbach wrote:
> On Wed, Apr 26, 2006, Andrew de Quincey wrote:
> > I just need to figure out a nice way to solve the problem Johannes raised
> > about the symbol_puts now.
> Maybe complement dvb_attach() with dvb_detach()?
> Or ignore the issue for now, lets see if it is really
> a problem for someone.

It would be a pain to impliment dvb_detach.  It needs the xxxx_attach() symbol
as an argument, it's not possible to use a function pointer.  This would be a
huge pain, as each driver, after calling videobuf_dvb_unregister() would need
to have a big switch statement for each card type:

	switch(dev->core->board) {
        case CX88_BOARD_KWORLD_DVB_T:
        case CX88_BOARD_DNTV_LIVE_DVB_T:
        case CX88_BOARD_ADSTECH_DVB_T_PCI:
	case CX88_BOARD_PCHDTV_HD3000:
	[ and so on]

Another possiblilty is to have dvb_attach call symbol_put() as soon as it is
done with the xxx_attach symbol.  The frontend release function wouldn't need
to call symbol_put() then.  You would need to add some kind of reference
counting to each frontend, so that it won't unload until all frontends that it
allocated with xxxx_attach have been released by calling the
frontend->release() method.

More information about the linux-dvb mailing list