From patchwork Tue Oct 25 19:23:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9395269 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 C063160233 for ; Tue, 25 Oct 2016 19:24:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B2982972D for ; Tue, 25 Oct 2016 19:24:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F384E29730; Tue, 25 Oct 2016 19:24:16 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 8B5FF2972D for ; Tue, 25 Oct 2016 19:24:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753282AbcJYTYO (ORCPT ); Tue, 25 Oct 2016 15:24:14 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:40555 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbcJYTYN (ORCPT ); Tue, 25 Oct 2016 15:24:13 -0400 Received: by mail-wm0-f66.google.com with SMTP id b80so1900814wme.7 for ; Tue, 25 Oct 2016 12:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=wfuob1zew3k5Ez8yIgiTzn9cMo+9Q8fl6GVW7tJF9nQ=; b=IYuvIK0EdeZwlUnTFcOFhRrzOG/yDS9ZFlGTkAtsf6raYhAUrd67Am+ZVXlE7TWw5I HQe3P90pt1imhaQDCMu1WKv0CHfqjo2VhF0Z0Yb8Sg6XHGmdA0W0tZlI7GF2dX4NuoCk i9UnMA77yNvrs7hmhl9XgryX4L9tvxPXD1IPAC6bFiG/ppI5uDD5DsdbAsUSjgPYNq5R pv2miRXZVVhdJiIlc5pY5UhB1P22ez7KLilHbu9JE/n8eEMdFTTHuLTH3j3mSMC23zKt U/HUNuCuGRhyRgL+/yGmSEx8SUW6RPCFPEUns3MOw2iq84Qa8dL/hFOcW4l8I4U+C6Gf fsNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=wfuob1zew3k5Ez8yIgiTzn9cMo+9Q8fl6GVW7tJF9nQ=; b=OwRS7e6PNYADPkIbSzu2cV4CsKZ2fJxMnKl/RoUbAktOnfaY0Zzwg+oSVmwXTmr+WG jJlAzrus8e8yMZGaSjsLgV9T0OWljGbtoGK81nlAUwIlEfts8fAGrBQfbxppaxyfaESj +EwZZANoyj2O1MSYqJanScq+69A66S8O541aq4KumvkyuPpfobsdlqiWng1MvUuqQNSO GGhCsmNPH4rw9SKkov04BMzapPHJiJbnbuUE24H+tF+G8p/GuytXFo8oJZkZTdvQVKxc Lys0ouNRQuPzoCapRCLVS0d90ZuO4zLukK8mjCqjg9t+uapMWj+WbkPMA4Af/fUvN8pF tE5g== X-Gm-Message-State: ABUngvclBL6bCuSp/qiZTEos9wA6iaHZ71/pkAJ/sl0FJhgLpAGs3aAvoN1p9qI7q9yh/w== X-Received: by 10.28.232.23 with SMTP id f23mr4912193wmh.125.1477423451969; Tue, 25 Oct 2016 12:24:11 -0700 (PDT) Received: from ?IPv6:2003:62:5f6e:ba00:954e:ed47:430f:d580? (p200300625F6EBA00954EED47430FD580.dip0.t-ipconnect.de. [2003:62:5f6e:ba00:954e:ed47:430f:d580]) by smtp.googlemail.com with ESMTPSA id s204sm5299900wmd.1.2016.10.25.12.24.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Oct 2016 12:24:11 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 1/5] media: rc: nuvoton: remove nvt_open and nvt_close To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Message-ID: <07318f26-3d54-d01e-c5eb-880acc0e04a4@gmail.com> Date: Tue, 25 Oct 2016 21:23:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 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 What is done in nvt_probe was done in nvt_probe already (in nvt_cir_ldev_init and nvt_cir_regs_init, both called from nvt_probe). It's the same with nvt_close, it's covered by nvt_remove. Therefore I don't see any benefit in implementing the open and close hooks at all and both functions can be removed. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 3df3bd9..37fce7b 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c @@ -964,39 +964,6 @@ static void nvt_disable_cir(struct nvt_dev *nvt) nvt_disable_logical_dev(nvt, LOGICAL_DEV_CIR); } -static int nvt_open(struct rc_dev *dev) -{ - struct nvt_dev *nvt = dev->priv; - unsigned long flags; - - spin_lock_irqsave(&nvt->nvt_lock, flags); - - /* set function enable flags */ - nvt_cir_reg_write(nvt, CIR_IRCON_TXEN | CIR_IRCON_RXEN | - CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, - CIR_IRCON); - - /* clear all pending interrupts */ - nvt_cir_reg_write(nvt, 0xff, CIR_IRSTS); - - /* enable interrupts */ - nvt_set_cir_iren(nvt); - - spin_unlock_irqrestore(&nvt->nvt_lock, flags); - - /* enable the CIR logical device */ - nvt_enable_logical_dev(nvt, LOGICAL_DEV_CIR); - - return 0; -} - -static void nvt_close(struct rc_dev *dev) -{ - struct nvt_dev *nvt = dev->priv; - - nvt_disable_cir(nvt); -} - /* Allocate memory, probe hardware, and initialize everything */ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) { @@ -1075,8 +1042,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) rdev->priv = nvt; rdev->driver_type = RC_DRIVER_IR_RAW; rdev->allowed_protocols = RC_BIT_ALL; - rdev->open = nvt_open; - rdev->close = nvt_close; rdev->tx_ir = nvt_tx_ir; rdev->s_tx_carrier = nvt_set_tx_carrier; rdev->input_name = "Nuvoton w836x7hg Infrared Remote Transceiver";