From patchwork Wed Nov 25 12:05:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 62762 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAPC3VeC016032 for ; Wed, 25 Nov 2009 12:05:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758743AbZKYMFP (ORCPT ); Wed, 25 Nov 2009 07:05:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758747AbZKYMFP (ORCPT ); Wed, 25 Nov 2009 07:05:15 -0500 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:59984 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758743AbZKYMFO (ORCPT ); Wed, 25 Nov 2009 07:05:14 -0500 Received: from m3.gw.fujitsu.co.jp ([10.0.50.73]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id nAPC5JIS001673 for (envelope-from kaneshige.kenji@jp.fujitsu.com); Wed, 25 Nov 2009 21:05:19 +0900 Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 6630345DE51 for ; Wed, 25 Nov 2009 21:05:19 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 46F5145DE4E for ; Wed, 25 Nov 2009 21:05:19 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 2841D1DB8042 for ; Wed, 25 Nov 2009 21:05:19 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id C66E91DB8038 for ; Wed, 25 Nov 2009 21:05:18 +0900 (JST) Received: from m108.css.fujitsu.com (m108 [127.0.0.1]) by m108.s.css.fujitsu.com (Postfix) with ESMTP id A2A03428057; Wed, 25 Nov 2009 21:05:18 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.137]) by m108.s.css.fujitsu.com (Postfix) with ESMTP id 4E804428054; Wed, 25 Nov 2009 21:05:18 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.100.137] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.137]); Wed, 25 Nov 2009 21:05:04 +0900 (JST) Message-ID: <4B0D1D6D.4050109@jp.fujitsu.com> Date: Wed, 25 Nov 2009 21:05:01 +0900 From: Kenji Kaneshige User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: linux-pci@vger.kernel.org, jbarnes@virtuousgeek.org Subject: [PATCH 8/11] portdrv: add missing irq cleanup References: <4B0D1C19.8060201@jp.fujitsu.com> In-Reply-To: <4B0D1C19.8060201@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Index: 20091125/drivers/pci/pcie/portdrv_core.c =================================================================== --- 20091125.orig/drivers/pci/pcie/portdrv_core.c +++ 20091125/drivers/pci/pcie/portdrv_core.c @@ -205,6 +205,14 @@ static int init_service_irqs(struct pci_ return 0; } +static void cleanup_service_irqs(struct pci_dev *dev) +{ + if (dev->msix_enabled) + pci_disable_msix(dev); + else if (dev->msi_enabled) + pci_disable_msi(dev); +} + /** * get_port_device_capability - discover capabilities of a PCI Express port * @dev: PCI Express port to examine @@ -332,10 +340,12 @@ int pcie_port_device_register(struct pci } if (!nr_serv) { status = -ENODEV; - goto error_disable; + goto error_cleanup_irqs; } return 0; +error_cleanup_irqs: + cleanup_service_irqs(dev); error_disable: pci_disable_device(dev); error_kfree: @@ -410,12 +420,7 @@ void pcie_port_device_remove(struct pci_ struct pcie_port_data *port_data = pci_get_drvdata(dev); device_for_each_child(&dev->dev, NULL, remove_iter); - - if (dev->msix_enabled) - pci_disable_msix(dev); - else if (dev->msi_enabled) - pci_disable_msi(dev); - + cleanup_service_irqs(dev); pci_disable_device(dev); kfree(port_data); }