From patchwork Sun Aug 20 10:41:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9911077 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 8FAEA600C8 for ; Sun, 20 Aug 2017 10:41:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E7E1287D6 for ; Sun, 20 Aug 2017 10:41:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71B39287DB; Sun, 20 Aug 2017 10:41:40 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 EFE84287D6 for ; Sun, 20 Aug 2017 10:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752619AbdHTKlX (ORCPT ); Sun, 20 Aug 2017 06:41:23 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:38255 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751634AbdHTKlT (ORCPT ); Sun, 20 Aug 2017 06:41:19 -0400 Received: by mail-wr0-f194.google.com with SMTP id k10so256394wre.5 for ; Sun, 20 Aug 2017 03:41:18 -0700 (PDT) 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=LDuasv7mEyOP92DriB/CJt0XYniBDUbWZ5EU7MhLFFA=; b=KIXxj9gSmpX35CBQDaB/mPSH8lj7MmYrB376ctwkOX1+bHwv06lZwKRMV8EqFSreqO v6oU5BKF6bps7ERfRz+SPb71MN98RUtqaNbV2x6oqtObwhDRcMYQyNtg4okMxFXRgi/Z HZ4SQuM8WtU+yFxV1GKugS8S6C2g5T+TmY/NkO2JJLsIDqH7GEWEc718woIdepyv+AvI wmZF/a4Ybo6X7/CGC4e01wOJGkaZZWtoiYf/STnXNBKlAF5HnHqDngcEbs/ujCS1510m +6HtAtF7vr2glcehKHgW10NmATKespUrg8TMnzPxBg2zrBrplGW29vv0zrJEzzbYo2WO fBYA== 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=LDuasv7mEyOP92DriB/CJt0XYniBDUbWZ5EU7MhLFFA=; b=Z0TVeL5BxeTJ4D2N1LLQAAw1Dsuz96TRa1nxXUunOI/WNViHAcEYC9hPCF2dokPqF4 ZfxBLajaAZNw2NQRd77P6gvVg5lGj5k8ZVPbC+mn8QIWPKz+rr+kHb9t7gOMeWuR8pUI mPszBAiWq46qJ2gfs0IdVO0iXjpwwyHvHW2Lzb40LfWybDAPQRfk1HAfu9w1EIdUmqYO zHMMELVYNGNc9pdOcYbTfiobKEB3P+e2Pyu/d4ftM+qZc49tDMZgzmdDszo5RNrP2Lzx uWANJvJBIgDBu7iR1m68MBeOFQPSe2OeEkFdTcz8RI/DOcG8wAhSe05WJ1uZQAIgL8Cg tlJw== X-Gm-Message-State: AHYfb5hNDrcWkyAeVOoYoCSHBW9IiQzE1835yRbv97nBtb4VdufIx0Fc trPPR9GZeAdFio4Y X-Received: by 10.223.146.195 with SMTP id 61mr9395485wrn.169.1503225677981; Sun, 20 Aug 2017 03:41:17 -0700 (PDT) Received: from dvbdev.wuest.de (ip-84-118-193-88.unity-media.net. [84.118.193.88]) by smtp.gmail.com with ESMTPSA id l3sm5777601wrc.4.2017.08.20.03.41.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 20 Aug 2017 03:41:17 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: jasmin@anw.at, rjkm@metzlerbros.de Subject: [PATCH 2/6] [media] ddbridge: move ddb_unmap(), cleanup modparams Date: Sun, 20 Aug 2017 12:41:10 +0200 Message-Id: <20170820104114.6515-3-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170820104114.6515-1-d.scheller.oss@gmail.com> References: <20170820104114.6515-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 adapter_alloc is only used from within ddbridge-core, so move it there, this removes the need for prototyping/referencing the variable. While at it, msi isn't needed outside of ddbridge-main, so don't extref that one aswell. Signed-off-by: Daniel Scheller --- drivers/media/pci/ddbridge/ddbridge-core.c | 18 ++++++++++++++++++ drivers/media/pci/ddbridge/ddbridge-main.c | 20 ++------------------ drivers/media/pci/ddbridge/ddbridge.h | 3 +-- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index 98a12c644e44..070e382db9ad 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -58,10 +58,21 @@ #define DDB_MAX_ADAPTER 64 +/****************************************************************************/ + DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); +static int adapter_alloc; +module_param(adapter_alloc, int, 0444); +MODULE_PARM_DESC(adapter_alloc, + "0-one adapter per io, 1-one per tab with io, 2-one per tab, 3-one for all"); + +/****************************************************************************/ + DEFINE_MUTEX(redirect_lock); +struct workqueue_struct *ddb_wq; + static struct ddb *ddbs[DDB_MAX_ADAPTER]; /****************************************************************************/ @@ -3612,3 +3623,10 @@ int ddb_init(struct ddb *dev) dev_err(dev->dev, "fail1\n"); return -1; } + +void ddb_unmap(struct ddb *dev) +{ + if (dev->regs) + iounmap(dev->regs); + vfree(dev); +} diff --git a/drivers/media/pci/ddbridge/ddbridge-main.c b/drivers/media/pci/ddbridge/ddbridge-main.c index 3cb6bb265172..25e9bd7d4fc1 100644 --- a/drivers/media/pci/ddbridge/ddbridge-main.c +++ b/drivers/media/pci/ddbridge/ddbridge-main.c @@ -41,16 +41,11 @@ /****************************************************************************/ /* module parameters */ -int adapter_alloc; -module_param(adapter_alloc, int, 0444); -MODULE_PARM_DESC(adapter_alloc, - "0-one adapter per io, 1-one per tab with io, 2-one per tab, 3-one for all"); - #ifdef CONFIG_PCI_MSI #ifdef CONFIG_DVB_DDBRIDGE_MSIENABLE -int msi = 1; +static int msi = 1; #else -int msi; +static int msi; #endif module_param(msi, int, 0444); #ifdef CONFIG_DVB_DDBRIDGE_MSIENABLE @@ -89,20 +84,9 @@ module_param(stv0910_single, int, 0444); MODULE_PARM_DESC(stv0910_single, "use stv0910 cards as single demods"); /****************************************************************************/ - -struct workqueue_struct *ddb_wq; - -/****************************************************************************/ /****************************************************************************/ /****************************************************************************/ -static void ddb_unmap(struct ddb *dev) -{ - if (dev->regs) - iounmap(dev->regs); - vfree(dev); -} - static void ddb_irq_disable(struct ddb *dev) { ddbwritel(dev, 0, INTERRUPT_ENABLE); diff --git a/drivers/media/pci/ddbridge/ddbridge.h b/drivers/media/pci/ddbridge/ddbridge.h index 91b58eff951c..9ca94a4f82ee 100644 --- a/drivers/media/pci/ddbridge/ddbridge.h +++ b/drivers/media/pci/ddbridge/ddbridge.h @@ -369,8 +369,6 @@ int ddbridge_flashread(struct ddb *dev, u32 link, u8 *buf, u32 addr, u32 len); /****************************************************************************/ /* ddbridge-main.c (modparams) */ -extern int adapter_alloc; -extern int msi; extern int ci_bitrate; extern int ts_loop; extern int xo2_speed; @@ -394,5 +392,6 @@ int ddb_device_create(struct ddb *dev); int ddb_class_create(void); void ddb_class_destroy(void); int ddb_init(struct ddb *dev); +void ddb_unmap(struct ddb *dev); #endif /* DDBRIDGE_H */