[linux-dvb] never do symbol_put(tunerfoo_attach);

mkrufky at linuxtv.org mkrufky at linuxtv.org
Sat Nov 17 00:37:30 CET 2007


Michel Ludwig wrote:
> Hi Mike,
>
> On Fri 16 Nov 2007, mkrufky at linuxtv.org wrote:
>   
>> Mauro and Michel,
>>
>> This changeset is wrong:
>>
>> http://linuxtv.org/hg/~mchehab/tm6000/rev/79f9210425e2
>>
>> You should not " symbol_put(xc3028_attach); " , because you don't always
>> know that we're dealing with that tuner.
>>     
>
> We know that because it's the only tuner that I've ever seen on tm6000 
> devices :-)
>   
We like to make linuxtv drivers modular and forward compatible.  There 
_are_ devices out there that use other tuners, and if you hardcode 
xc3028 into this driver, it prevents future developers from adding 
support for other devices without having to change existing code.
> But anyway, how would dvb_frontend_detach(fe) release the xc3028_attach 
> symbol, which is requested by dvb_attach?

The answer is self-explanatory.  Take a look at the other drivers, and 
take a look at dvb_frontend_detach.   (dvb_frontend.c , lines 1204 thru 
1221)

Better to use the established methods, and have uniform codingstyle 
across the tree -- don't reinvent the wheel ;-)

-Mike



More information about the linux-dvb mailing list