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

Andrew de Quincey adq_dvb at lidskialf.net
Thu Apr 27 13:31:58 CEST 2006

On Thursday 27 April 2006 00:57, Trent Piepho wrote:
> 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:
> 		dvb_detach(mt352_attach);
> 		break;
> 	case CX88_BOARD_PCHDTV_HD3000:
> 		dvb_detach(or51132_attach);
> 		break;
> 	[ 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.

New patch in my v4l-dvb-attach tree with your revised dvb_attach() and also my 
idea for using module reference counts.

BTW: don't worry about the order of the patches and the number of them in that 
tree - I'll redo them if/when they're submitted for inclusion in the mainline 
anyway - no point cluttering that up with all the half-correct solutions we 
go through.

More information about the linux-dvb mailing list