From patchwork Sat Aug 28 08:56:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Cai,Huoqing" X-Patchwork-Id: 12463315 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDD3BC432BE for ; Sat, 28 Aug 2021 08:57:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB71360FED for ; Sat, 28 Aug 2021 08:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233585AbhH1I5t (ORCPT ); Sat, 28 Aug 2021 04:57:49 -0400 Received: from mx21.baidu.com ([220.181.3.85]:52584 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233446AbhH1I5s (ORCPT ); Sat, 28 Aug 2021 04:57:48 -0400 Received: from BC-Mail-Ex07.internal.baidu.com (unknown [172.31.51.47]) by Forcepoint Email with ESMTPS id 6B1FFA6BB270BB89359D; Sat, 28 Aug 2021 16:56:56 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-EX07.internal.baidu.com (172.31.51.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Sat, 28 Aug 2021 16:56:56 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.62.18) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Sat, 28 Aug 2021 16:56:55 +0800 From: Cai Huoqing To: CC: , , Cai Huoqing Subject: [PATCH] PCI: Make use of the helper macro SET_RUNTIME_PM_OPS() Date: Sat, 28 Aug 2021 16:56:42 +0800 Message-ID: <20210828085642.559-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.32.0.windows.2 MIME-Version: 1.0 X-Originating-IP: [172.31.62.18] X-ClientProxiedBy: BC-Mail-Ex18.internal.baidu.com (172.31.51.12) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose operators ".runtime_suspend/.runtime_resume/.runtime_idle", because the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought in to make code a little clearer, a little more concise. Signed-off-by: Cai Huoqing --- drivers/pci/pci-driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index a0615395500a..deddd0e28e6c 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -1330,6 +1330,7 @@ static int pci_pm_runtime_idle(struct device *dev) } static const struct dev_pm_ops pci_dev_pm_ops = { + SET_RUNTIME_PM_OPS(pci_pm_runtime_suspend, pci_pm_runtime_resume, pci_pm_runtime_idle) .prepare = pci_pm_prepare, .complete = pci_pm_complete, .suspend = pci_pm_suspend, @@ -1347,9 +1348,6 @@ static const struct dev_pm_ops pci_dev_pm_ops = { .thaw_noirq = pci_pm_thaw_noirq, .poweroff_noirq = pci_pm_poweroff_noirq, .restore_noirq = pci_pm_restore_noirq, - .runtime_suspend = pci_pm_runtime_suspend, - .runtime_resume = pci_pm_runtime_resume, - .runtime_idle = pci_pm_runtime_idle, }; #define PCI_PM_OPS_PTR (&pci_dev_pm_ops)