@@ -1255,11 +1255,6 @@ static void dvb_input_detach(struct ddb_input *input)
switch (dvb->attached) {
case 0x31:
- client = dvb->i2c_client[0];
- if (client) {
- module_put(client->dev.driver->owner);
- i2c_unregister_device(client);
- }
if (dvb->fe2)
dvb_unregister_frontend(dvb->fe2);
if (dvb->fe)
@@ -1273,6 +1268,12 @@ static void dvb_input_detach(struct ddb_input *input)
dvb->fe = dvb->fe2 = NULL;
/* fallthrough */
case 0x20:
+ client = dvb->i2c_client[0];
+ if (client) {
+ module_put(client->dev.driver->owner);
+ i2c_unregister_device(client);
+ }
+
dvb_net_release(&dvb->dvbnet);
/* fallthrough */
case 0x12: