summaryrefslogtreecommitdiff
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorDaniel Scheller <d.scheller@gmx.net>2018-02-08 22:53:12 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-06 16:42:59 +0300
commit9403f089bfa0536dbad1a28419aff037dc575c3d (patch)
tree0b017fed42bce8671507d1213ef8b57423e91f93 /drivers/media/pci
parente2ce49468a14d5c1543bfd60385ff47b8aebfb0c (diff)
downloadlinux-9403f089bfa0536dbad1a28419aff037dc575c3d.tar.xz
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: 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.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge-ci.c b/drivers/media/pci/ddbridge/ddbridge-ci.c
index 5828111487b0..ed19890710d6 100644
--- a/drivers/media/pci/ddbridge/ddbridge-ci.c
+++ b/drivers/media/pci/ddbridge/ddbridge-ci.c
@@ -325,24 +325,20 @@ int ddb_ci_attach(struct ddb_port *port, u32 bitrate)
case DDB_CI_EXTERNAL_SONY:
cxd_cfg.bitrate = bitrate;
port->en = cxd2099_attach(&cxd_cfg, port, &port->i2c->adap);
- if (!port->en)
- return -ENODEV;
break;
-
case DDB_CI_EXTERNAL_XO2:
case DDB_CI_EXTERNAL_XO2_B:
ci_xo2_attach(port);
- if (!port->en)
- return -ENODEV;
break;
-
case DDB_CI_INTERNAL:
ci_attach(port);
- if (!port->en)
- return -ENODEV;
break;
+ default:
+ return -ENODEV;
}
+ if (!port->en)
+ return -ENODEV;
dvb_ca_en50221_init(port->dvb[0].adap, port->en, 0, 1);
return 0;
}