From: Daniel Scheller Date: Thu, 8 Feb 2018 19:53:12 +0000 (-0500) Subject: media: ddbridge/ci: further deduplicate code/logic in ddb_ci_attach() X-Git-Tag: v4.19~1321^2~221 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9403f089bfa0536dbad1a28419aff037dc575c3d;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/ddbridge/ddbridge-ci.c b/drivers/media/pci/ddbridge/ddbridge-ci.c index 5828111..ed19890 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; }