From patchwork Sat Sep 12 18:10:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 7167101 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6672CBEEC1 for ; Sat, 12 Sep 2015 18:11:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C52920723 for ; Sat, 12 Sep 2015 18:11:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A51FE206F7 for ; Sat, 12 Sep 2015 18:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754707AbbILSLb (ORCPT ); Sat, 12 Sep 2015 14:11:31 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:33584 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753965AbbILSLR (ORCPT ); Sat, 12 Sep 2015 14:11:17 -0400 Received: by wiclk2 with SMTP id lk2so96489556wic.0 for ; Sat, 12 Sep 2015 11:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A9QDRe3Vc/JPA/ipncda47R5xzz/TcwBNB5gs4eycbc=; b=I6R47mXENFHIuKhEUD/4GzpdepSGaIxerqujglJvjpDW0Q3h24ooUu9y/yMXCaFcUP U3Xl+4bPq0OKH9mLgr0PLp6SjHaAAXTpblh4TwIXih07PmMbPKRpCobrfBXimqjf5GuL nMzqc4cgMAEaicQ8AiEes7oemtQdbjOi6amwAaQv5B4VkiCSmkhVUQlDaTmfO82KxQR6 RAPtUjlEK0C33jvdRUT3vjHLhtBWr8IgNAI5qKhfoz8Qqzslgu+rniHsEGt5Xsd7Y5v/ tIym9IMgW5yOlu7LLDHx/IlCxZMwGIdPHxdXaQSbrEG8CgHCJTGurVAe0seffk8rxu91 hkhQ== X-Received: by 10.180.35.163 with SMTP id i3mr8903612wij.55.1442081475924; Sat, 12 Sep 2015 11:11:15 -0700 (PDT) Received: from tipsey.3.home (188.31.129.159.threembb.co.uk. [188.31.129.159]) by smtp.gmail.com with ESMTPSA id c3sm6628188wja.3.2015.09.12.11.11.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 12 Sep 2015 11:11:15 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 11/11] staging: vt6655: Move code in device_get_pci_info Date: Sat, 12 Sep 2015 19:10:38 +0100 Message-Id: <1442081438-3485-11-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1442081438-3485-1-git-send-email-tvboxspy@gmail.com> References: <1442081438-3485-1-git-send-email-tvboxspy@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Function always returns true and now only a few lines move to vt6655_probe. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/device_main.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index add9cdf..326bce3 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -29,7 +29,6 @@ * vt6655_probe - module initial (insmod) driver entry * vt6655_remove - module remove entry * device_free_info - device structure resource free function - * device_get_pci_info - get allocated pci io/mem resource * device_print_info - print out resource * device_rx_srv - rx service function * device_alloc_rx_buf - rx buffer pre-allocated function @@ -136,7 +135,6 @@ static const struct pci_device_id vt6655_pci_id_table[] = { static int vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent); static void device_free_info(struct vnt_private *pDevice); -static bool device_get_pci_info(struct vnt_private *, struct pci_dev *pcid); static void device_print_info(struct vnt_private *pDevice); static void device_init_rd0_ring(struct vnt_private *pDevice); @@ -430,17 +428,6 @@ static void device_print_info(struct vnt_private *pDevice) (unsigned long)pDevice->PortOffset, pDevice->pcid->irq); } -static bool device_get_pci_info(struct vnt_private *pDevice, - struct pci_dev *pcid) -{ - pci_set_master(pcid); - - pDevice->memaddr = pci_resource_start(pcid, 0); - pDevice->ioaddr = pci_resource_start(pcid, 1); - - return true; -} - static void device_free_info(struct vnt_private *pDevice) { if (!pDevice) @@ -1629,12 +1616,10 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) dev_dbg(&pcid->dev, "Before get pci_info memaddr is %x\n", priv->memaddr); - if (!device_get_pci_info(priv, pcid)) { - dev_err(&pcid->dev, ": Failed to find PCI device.\n"); - device_free_info(priv); - return -ENODEV; - } + pci_set_master(pcid); + priv->memaddr = pci_resource_start(pcid, 0); + priv->ioaddr = pci_resource_start(pcid, 1); priv->PortOffset = ioremap(priv->memaddr & PCI_BASE_ADDRESS_MEM_MASK, 256); if (!priv->PortOffset) {