[media] cx23885: add I2C client for CI into state and handle unregistering
authorOlli Salonen <olli.salonen@iki.fi>
Mon, 29 Sep 2014 07:44:19 +0000 (04:44 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 30 Oct 2014 13:48:39 +0000 (11:48 -0200)
If the CI chip has an I2C driver, we need to store I2C client into state.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/cx23885/cx23885-dvb.c
drivers/media/pci/cx23885/cx23885.h

index 062854d30a75357b9a24cf652c9cbc615cea04e6..5ea1027878ba0d5afa0cc3d9069e2cc6796299d3 100644 (file)
@@ -1914,6 +1914,13 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port)
        struct vb2_dvb_frontend *fe0;
        struct i2c_client *client;
 
+       /* remove I2C client for CI */
+       client = port->i2c_client_ci;
+       if (client) {
+               module_put(client->dev.driver->owner);
+               i2c_unregister_device(client);
+       }
+
        /* remove I2C client for tuner */
        client = port->i2c_client_tuner;
        if (client) {
index 33b1e26847a287734bddd07672ea3ae96ca71b40..27ea249d07cfb9ec95a810c92781d845e989ae8a 100644 (file)
@@ -297,6 +297,7 @@ struct cx23885_tsport {
 
        struct i2c_client *i2c_client_demod;
        struct i2c_client *i2c_client_tuner;
+       struct i2c_client *i2c_client_ci;
 
        int (*set_frontend)(struct dvb_frontend *fe);
        int (*fe_set_voltage)(struct dvb_frontend *fe,