diff options
author | Daniel Scheller <d.scheller@gmx.net> | 2017-12-17 18:40:45 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-19 15:19:51 +0300 |
commit | 12081a25a676ba102046e4742190bcd134d0442b (patch) | |
tree | c52ee144a126e288bfc65fabd61b52e7f346ace7 /drivers/media/pci | |
parent | ae49432810c5cca2143afc1445edad6582c9f270 (diff) | |
download | linux-12081a25a676ba102046e4742190bcd134d0442b.tar.xz |
media: ddbridge: move CI detach code to ddbridge-ci.c
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>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/ddbridge/ddbridge-ci.c | 11 | ||||
-rw-r--r-- | drivers/media/pci/ddbridge/ddbridge-ci.h | 1 | ||||
-rw-r--r-- | drivers/media/pci/ddbridge/ddbridge-core.c | 8 |
3 files changed, 13 insertions, 7 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge-ci.c b/drivers/media/pci/ddbridge/ddbridge-ci.c index 8dfbc3bbd86d..5828111487b0 100644 --- a/drivers/media/pci/ddbridge/ddbridge-ci.c +++ b/drivers/media/pci/ddbridge/ddbridge-ci.c @@ -346,3 +346,14 @@ int ddb_ci_attach(struct ddb_port *port, u32 bitrate) 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; + } +} diff --git a/drivers/media/pci/ddbridge/ddbridge-ci.h b/drivers/media/pci/ddbridge/ddbridge-ci.h index 3a5d7ffab7b7..35a39182dd83 100644 --- a/drivers/media/pci/ddbridge/ddbridge-ci.h +++ b/drivers/media/pci/ddbridge/ddbridge-ci.h @@ -26,5 +26,6 @@ /******************************************************************************/ int ddb_ci_attach(struct ddb_port *port, u32 bitrate); +void ddb_ci_detach(struct ddb_port *port); #endif /* __DDBRIDGE_CI_H__ */ diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index 5188f400957e..c7d923e0e21a 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -2016,13 +2016,7 @@ void ddb_ports_detach(struct ddb *dev) 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; } } |