Commit 9403f089 authored by Daniel Scheller's avatar Daniel Scheller Committed by Mauro Carvalho Chehab

media: ddbridge/ci: further deduplicate code/logic in ddb_ci_attach()

Deduplicate the checks for a valid ptr in port->en, and also handle the
default case to also catch eventually yet unsupported CI hardware.
Signed-off-by: default avatarDaniel Scheller <d.scheller@gmx.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent e2ce4946
...@@ -325,24 +325,20 @@ int ddb_ci_attach(struct ddb_port *port, u32 bitrate) ...@@ -325,24 +325,20 @@ 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;
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;
break; break;
case DDB_CI_INTERNAL: case DDB_CI_INTERNAL:
ci_attach(port); ci_attach(port);
if (!port->en)
return -ENODEV;
break; break;
default:
return -ENODEV;
} }
if (!port->en)
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);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment