1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

clean up ci attach and detach

This commit is contained in:
Ralph Metzler 2018-01-16 23:54:15 +01:00
parent 642a010be6
commit caa1dbecce
2 changed files with 6 additions and 11 deletions

View File

@ -325,26 +325,21 @@ int ddb_ci_attach(struct ddb_port *port, u32 bitrate)
case DDB_CI_EXTERNAL_SONY: case DDB_CI_EXTERNAL_SONY:
cxd_cfg.bitrate = bitrate; cxd_cfg.bitrate = bitrate;
port->en = cxd2099_attach(&cxd_cfg, port, &port->i2c->adap); port->en = cxd2099_attach(&cxd_cfg, port, &port->i2c->adap);
if (!port->en)
return -ENODEV;
dvb_ca_en50221_init(port->dvb[0].adap,
port->en, 0, 1);
break; break;
case DDB_CI_EXTERNAL_XO2: case DDB_CI_EXTERNAL_XO2:
case DDB_CI_EXTERNAL_XO2_B: case DDB_CI_EXTERNAL_XO2_B:
ci_xo2_attach(port); ci_xo2_attach(port);
if (!port->en)
return -ENODEV;
dvb_ca_en50221_init(port->dvb[0].adap, port->en, 0, 1);
break; break;
case DDB_CI_INTERNAL: case DDB_CI_INTERNAL:
ci_attach(port); ci_attach(port);
break;
default:
return -ENODEV;
}
if (!port->en) if (!port->en)
return -ENODEV; return -ENODEV;
dvb_ca_en50221_init(port->dvb[0].adap, port->en, 0, 1); dvb_ca_en50221_init(port->dvb[0].adap, port->en, 0, 1);
break;
}
return 0; return 0;
} }

View File

@ -2264,7 +2264,7 @@ void ddb_ports_detach(struct ddb *dev)
dvb_unregister_device(port->dvb[0].dev); dvb_unregister_device(port->dvb[0].dev);
if (port->en) { if (port->en) {
dvb_ca_en50221_release(port->en); dvb_ca_en50221_release(port->en);
kfree(port->en); kfree(port->en->data);
port->en = NULL; port->en = NULL;
} }
break; break;