Move the CI teardown code to ddbridge-ci.c where everything else related
to CI hardware lives.
Cc: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
dvb_ca_en50221_init(port->dvb[0].adap, port->en, 0, 1);
return 0;
}
+
+void ddb_ci_detach(struct ddb_port *port)
+{
+ if (port->dvb[0].dev)
+ dvb_unregister_device(port->dvb[0].dev);
+ if (port->en) {
+ dvb_ca_en50221_release(port->en);
+ kfree(port->en->data);
+ port->en = NULL;
+ }
+}
/******************************************************************************/
int ddb_ci_attach(struct ddb_port *port, u32 bitrate);
+void ddb_ci_detach(struct ddb_port *port);
#endif /* __DDBRIDGE_CI_H__ */
break;
case DDB_PORT_CI:
case DDB_PORT_LOOP:
- if (port->dvb[0].dev)
- dvb_unregister_device(port->dvb[0].dev);
- if (port->en) {
- dvb_ca_en50221_release(port->en);
- kfree(port->en->data);
- port->en = NULL;
- }
+ ddb_ci_detach(port);
break;
}
}