[linux-dvb] Question about i2c_add/del_driver()?

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

 



This question is specific to cx88 based drivers. I am 
unclear about which drivers should call i2c_add_driver() in 
the __init function. 

Module cx22702 is causing me confusion. Module cx88-dvb 
depends on cx8802, video-buf-dvb, cx88xx, video-buf, 
dvb-pll, or51132, mt352, cx22702. Only cx22702 calls 
i2c_add_driver() of all the different modules that cx88-dvb 
depends on. This shows up in dmseg as a report that the 
cx22702 drivers are added. But I don't have any cards that 
use the cx22702 in my system.

Is this an error or are the other drivers that use i2c (i.e. 
or51132, mt353) failing to register properly.

~~~~~~~~~~~~~~~

This is a separate but unrelated observation. Assuming that 
the cx22702 module is supposed  to call i2c_add_driver() 
there is a bug in the code. It does not handle any error 
returned by i2c_add_driver(). I suggest code something like 
this:

static int __init init_cx22702 (void)
{
	int ret;

	ret = i2c_add_driver(&demod_driver);
	if (ret) 
		return ret;

	ret = i2c_add_driver(&pll_driver);
	if (ret) {
		i2c_del_driver(&demod_driver);
		return ret;
	}
}



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

  Powered by Linux