@@ -425,6 +425,7 @@ int saa7164_dvb_unregister(struct saa7164_port *port)
struct saa7164_dev *dev = port->dev;
struct saa7164_buffer *b;
struct list_head *c, *n;
+ struct i2c_client *client;
dprintk(DBGLVL_DVB, "%s()\n", __func__);
@@ -451,6 +452,21 @@ int saa7164_dvb_unregister(struct saa7164_port *port)
dvb_unregister_frontend(dvb->frontend);
dvb_frontend_detach(dvb->frontend);
dvb_unregister_adapter(&dvb->adapter);
+
+ /* remove I2C client for tuner */
+ client = port->i2c_client_tuner;
+ if (client) {
+ module_put(client->dev.driver->owner);
+ i2c_unregister_device(client);
+ }
+
+ /* remove I2C client for demodulator */
+ client = port->i2c_client_demod;
+ if (client) {
+ module_put(client->dev.driver->owner);
+ i2c_unregister_device(client);
+ }
+
return 0;
}
@@ -422,6 +422,9 @@ struct saa7164_port {
u8 last_v_cc;
u8 last_a_cc;
u32 done_first_interrupt;
+
+ struct i2c_client *i2c_client_demod;
+ struct i2c_client *i2c_client_tuner;
};
struct saa7164_dev {
In order to support demodulators and tuners that have their drivers implemented as I2C drivers, the i2c_client should be stored in state for both. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> --- drivers/media/pci/saa7164/saa7164-dvb.c | 16 ++++++++++++++++ drivers/media/pci/saa7164/saa7164.h | 3 +++ 2 files changed, 19 insertions(+)