@@ -404,6 +404,9 @@ static int pvr2_dvb_frontend_init(struct pvr2_dvb_adapter *adap)
fail_frontend0:
dvb_frontend_detach(adap->fe[0]);
adap->fe[0] = NULL;
+ dvb_module_release(adap->i2c_client_tuner);
+ dvb_module_release(adap->i2c_client_demod[1]);
+ dvb_module_release(adap->i2c_client_demod[0]);
return ret;
}
@@ -420,6 +423,14 @@ static int pvr2_dvb_frontend_exit(struct pvr2_dvb_adapter *adap)
dvb_frontend_detach(adap->fe[0]);
adap->fe[0] = NULL;
}
+
+ dvb_module_release(adap->i2c_client_tuner);
+ adap->i2c_client_tuner = NULL;
+ dvb_module_release(adap->i2c_client_demod[1]);
+ adap->i2c_client_demod[1] = NULL;
+ dvb_module_release(adap->i2c_client_demod[0]);
+ adap->i2c_client_demod[0] = NULL;
+
return 0;
}
@@ -20,6 +20,9 @@ struct pvr2_dvb_adapter {
struct dvb_net dvb_net;
struct dvb_frontend *fe[2];
+ struct i2c_client *i2c_client_demod[2];
+ struct i2c_client *i2c_client_tuner;
+
int feedcount;
int max_feed_count;
Cleanup code has been added to init in case of failure, as well as to frontend exit. Signed-off-by: Brad Love <brad@nextdimension.cc> --- No changes drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 11 +++++++++++ drivers/media/usb/pvrusb2/pvrusb2-dvb.h | 3 +++ 2 files changed, 14 insertions(+)