From patchwork Thu Sep 22 02:46:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 12984387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D24EDC32771 for ; Thu, 22 Sep 2022 02:49:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiIVCtv (ORCPT ); Wed, 21 Sep 2022 22:49:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiIVCtu (ORCPT ); Wed, 21 Sep 2022 22:49:50 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B1B665552; Wed, 21 Sep 2022 19:49:48 -0700 (PDT) Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MY05G5SMcz14S2L; Thu, 22 Sep 2022 10:45:38 +0800 (CST) Received: from huawei.com (10.67.175.83) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 10:49:46 +0800 From: ruanjinjie To: , , , , CC: Subject: [PATCH -next] IB/hfi1,PCI: Fix missing pci_disable_device() in probe and remove Date: Thu, 22 Sep 2022 10:46:01 +0800 Message-ID: <20220922024601.3643622-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.67.175.83] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Replace pci_enable_device() with pcim_enable_device(), pci_disable_device() and pci_release_regions() will be called in release automatically. Signed-off-by: ruanjinjie --- drivers/infiniband/hw/hfi1/pcie.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c index a0802332c8cb..45a0fb75f2d8 100644 --- a/drivers/infiniband/hw/hfi1/pcie.c +++ b/drivers/infiniband/hw/hfi1/pcie.c @@ -26,7 +26,7 @@ int hfi1_pcie_init(struct hfi1_devdata *dd) int ret; struct pci_dev *pdev = dd->pcidev; - ret = pci_enable_device(pdev); + ret = pcim_enable_device(pdev); if (ret) { /* * This can happen (in theory) iff: @@ -78,12 +78,10 @@ int hfi1_pcie_init(struct hfi1_devdata *dd) */ void hfi1_pcie_cleanup(struct pci_dev *pdev) { - pci_disable_device(pdev); /* * Release regions should be called after the disable. OK to * call if request regions has not been called or failed. */ - pci_release_regions(pdev); } /*