From patchwork Mon Apr 15 06:58:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 2443971 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1A0A5DF2E5 for ; Mon, 15 Apr 2013 06:59:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753310Ab3DOG76 (ORCPT ); Mon, 15 Apr 2013 02:59:58 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:24834 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753269Ab3DOG75 (ORCPT ); Mon, 15 Apr 2013 02:59:57 -0400 Received: from 172.24.2.119 (EHLO szxeml207-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BAA88916; Mon, 15 Apr 2013 14:59:46 +0800 (CST) Received: from SZXEML422-HUB.china.huawei.com (10.82.67.161) by szxeml207-edg.china.huawei.com (172.24.2.56) with Microsoft SMTP Server (TLS) id 14.1.323.7; Mon, 15 Apr 2013 14:59:38 +0800 Received: from localhost (10.135.76.69) by szxeml422-hub.china.huawei.com (10.82.67.161) with Microsoft SMTP Server id 14.1.323.7; Mon, 15 Apr 2013 14:59:34 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , Tony Luck , Hanjun Guo , , Yijing Wang , Kenji Kaneshige , Shengzhou Liu Subject: [PATCH -v2 1/2] PCI: decrease pci_dev->enable_cnt when no pcie capability found Date: Mon, 15 Apr 2013 14:58:54 +0800 Message-ID: <1366009135-19088-1-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.11.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.135.76.69] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org We should decrease dev->enable_cnt when no pcie port capability found for balance. Signed-off-by: Yijing Wang Cc: Jiang Liu Cc: Kenji Kaneshige Cc: Shengzhou Liu --- drivers/pci/pcie/portdrv_core.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 31063ac..aef3fac 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -369,8 +369,8 @@ int pcie_port_device_register(struct pci_dev *dev) /* Get and check PCI Express port services */ capabilities = get_port_device_capability(dev); - if (!capabilities) - return 0; + if (!capabilities) + goto error_disable; pci_set_master(dev); /*