From patchwork Sun Dec 17 15:40:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10117747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B41E605B4 for ; Sun, 17 Dec 2017 15:41:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31E99292A1 for ; Sun, 17 Dec 2017 15:41:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2689D293A2; Sun, 17 Dec 2017 15:41:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD42E293AD for ; Sun, 17 Dec 2017 15:41:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754185AbdLQPlB (ORCPT ); Sun, 17 Dec 2017 10:41:01 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:45200 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752517AbdLQPk5 (ORCPT ); Sun, 17 Dec 2017 10:40:57 -0500 Received: by mail-wr0-f195.google.com with SMTP id h1so11890557wre.12 for ; Sun, 17 Dec 2017 07:40:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1rHV4QambDs3fxKmgptrM99y/EljLGReW+VKBy3Twb8=; b=bGbfnjf1+40rtxpW7qrm5/N5DYY9b2UIfqeA1/zg8irIRLeG/JLF13JyG0emhxlYf0 9o3gchMhynZFXSigflkh0o2q35GT1vD8EHHp2DleRBce1jnUmRB+mvgiCoxh+p0IfXk3 gELMKFSy7FS5lWVIpnzrNx92+2kP3J9Kn1GD46D7h1KVQmLVp7QwHvXSduxJgP18S8nT 6+3v1L3kGmZ60TbGf6zbXrGPw2ST082YX+/fd9PVHi/+TRjCzTGYzY37mnFr2ZtQUhnq OTd7Ih2Va87NPz3XWfaM5334wrs/3gDvkrWPIwVi/fUIACYE7HuCc1HbJ4e9++5jhNfd eNiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1rHV4QambDs3fxKmgptrM99y/EljLGReW+VKBy3Twb8=; b=SXu6yTtqcarhgdOuLBBIr8OsurNTzgTEBAxILmU8S7dLFjDAF3v0ErMlxoLEGyWQlw QtcU+wzaqZEtE67e5qV0GvShZ3sqP8aO+el1Nt6gv6B85K8miWVecJ/jXLFOKvuwQaR6 cdH+KA39lTrknNoAmKr8khUBf3Pkrs+IOWGVq+cPHBL8ZjmugWwa9huyGwwBlfbxKL6t 5sPSZ44eQotS86GNLkO/RtI/Y2e5QgdoHYctd75EraBg510hCkxWQYGTZUcHxpKIfSFq U5Ogk5l4OAfVgp6B6bNS75RF1VpisDerqaho71Je56nwgxqKbZS676DVPZbFhGNUWkU0 XdCA== X-Gm-Message-State: AKGB3mLeBL/T3RlcThB551+zXFmZfeZAt8cFWkURzqJOuJVSEyKFY06l UjpDSZiJWRTXIe0h9Hnav7RJgw== X-Google-Smtp-Source: ACJfBouBdfuKHnl0FS355OrT+RPsd6Y+xTn7J9Ii95J8nsXj9IKQa9BRdv3jWIdCAd5kfmmp/YMtwA== X-Received: by 10.223.185.85 with SMTP id b21mr3357854wrg.264.1513525256533; Sun, 17 Dec 2017 07:40:56 -0800 (PST) Received: from dvbdev.wuest.de (ip-84-118-193-200.unity-media.net. [84.118.193.200]) by smtp.gmail.com with ESMTPSA id m52sm2420974wrm.12.2017.12.17.07.40.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Dec 2017 07:40:56 -0800 (PST) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: Ralph Metzler Subject: [PATCH 3/8] [media] ddbridge: deduplicate calls to dvb_ca_en50221_init() Date: Sun, 17 Dec 2017 16:40:44 +0100 Message-Id: <20171217154049.1125-4-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171217154049.1125-1-d.scheller.oss@gmail.com> References: <20171217154049.1125-1-d.scheller.oss@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Scheller All CI types do dvb_ca_en50221_init() with the same arguments. Move this call after the switch-case to remove the repetition in every case block. Cc: Ralph Metzler Signed-off-by: Daniel Scheller --- drivers/media/pci/ddbridge/ddbridge-ci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-ci.c b/drivers/media/pci/ddbridge/ddbridge-ci.c index a4fd747763a0..8dfbc3bbd86d 100644 --- a/drivers/media/pci/ddbridge/ddbridge-ci.c +++ b/drivers/media/pci/ddbridge/ddbridge-ci.c @@ -327,8 +327,6 @@ int ddb_ci_attach(struct ddb_port *port, u32 bitrate) 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; case DDB_CI_EXTERNAL_XO2: @@ -336,15 +334,15 @@ int ddb_ci_attach(struct ddb_port *port, u32 bitrate) ci_xo2_attach(port); if (!port->en) return -ENODEV; - dvb_ca_en50221_init(port->dvb[0].adap, port->en, 0, 1); break; case DDB_CI_INTERNAL: ci_attach(port); if (!port->en) return -ENODEV; - dvb_ca_en50221_init(port->dvb[0].adap, port->en, 0, 1); break; } + + dvb_ca_en50221_init(port->dvb[0].adap, port->en, 0, 1); return 0; }