Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2021898pxb; Sat, 28 Aug 2021 02:04:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT0uHsaDU1dWYqEB26TgYTuGE1fjEn4By7MlGZCVOO1PEhqq+bIcB33Kpylo6E0x2DKP+H X-Received: by 2002:a17:906:9388:: with SMTP id l8mr14157323ejx.307.1630141447156; Sat, 28 Aug 2021 02:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630141447; cv=none; d=google.com; s=arc-20160816; b=KXaOwPQyCJ9AN5mtMp24kKMwtWOT2pQLZOms9PDyGyMhkIu3Rcmnyhlee5ZXolhQDz ItG9vYzXWkJ7429QuF1WO1mo8Du4fDzxpVVcPHnQNKluyR6YCXbCiYlrrtOqcZOPNlTG df9vXTtHvdOgzQ8Pp3NlFb1W6RUKSvImXLDMoJGDs4CTMtvxlzyHT+K0avtNUOjMm3uo YkEi3zvr6W/jk2uG4B5nfI2z1pbVmAnkGTCW/EtO7PyXhqhQUYiBC2NaMWrPqpdhvwdP buNQxST5iKUjgErbVVPCQp5oD5XIFnoCumk1Zd0rbLTYy0Dvd8Yd4jc84hU+33HsBTcf +VOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=P77LbsYDYI9DiBj5X9Lcdpdz4B07hYDAD4BeXBsGE8I=; b=g9XpgazSyHkyyNtywbhh6c8MeSP+10cEZyj+5XTtRPZv//6rpDheR+rqr+3jL5PHM7 rgr3gPA4OKwFacMkp8IKTha9c+pWEr0naD2J+A/IUaujfkez1IaYLHeNym51qypxlGeV 5LHk2yB4iy4xv04NwgYpDf+JF4VnQcR0qL92NZrHEX5IqPoJamrKS/wnep4N8rQLmxgV 8JD1Y2YtarqhPfZT3egOB/Ym68MyJ6Rl8+2rcEgyuXwQDS9oheWqRoj7DDFs0oME+pda JI4LnhB27GoyrkqYHKNehgpenwbupf3WtqMyv3UWfQ80QAIcIcXuYrpL4fW4RT7ZXv07 5iXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk20si6198656edb.188.2021.08.28.02.03.35; Sat, 28 Aug 2021 02:04:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233617AbhH1I7l (ORCPT + 99 others); Sat, 28 Aug 2021 04:59:41 -0400 Received: from mx21.baidu.com ([220.181.3.85]:54334 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233584AbhH1I7i (ORCPT ); Sat, 28 Aug 2021 04:59:38 -0400 Received: from BC-Mail-Ex03.internal.baidu.com (unknown [172.31.51.43]) by Forcepoint Email with ESMTPS id EA40F55558F5C2C6E396; Sat, 28 Aug 2021 16:58:44 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex03.internal.baidu.com (172.31.51.43) 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:58:44 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.62.20) 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:58:44 +0800 From: Cai Huoqing To: , CC: , , Cai Huoqing Subject: [PATCH] PCI/portdrv: Make use of the helper macro SET_SYSTEM_SLEEP_PM_OPS()/ SET_RUNTIME_PM_OPS() Date: Sat, 28 Aug 2021 16:58:30 +0800 Message-ID: <20210828085830.351-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.32.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.31.62.20] X-ClientProxiedBy: BC-Mail-Ex11.internal.baidu.com (172.31.51.51) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the helper macro SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS() instead of the verbose operators ".runtime_suspend/_resume/_idle" and ".suspend/.resume/.freeze/.thaw/.poweroff/.restore", because the helper macro SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS() could be brought in to make code a little clearer, a little more concise. Signed-off-by: Cai Huoqing --- drivers/pci/pcie/portdrv_pci.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index c7ff1eea225a..29d1c7de6410 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c @@ -70,17 +70,11 @@ static int pcie_port_runtime_idle(struct device *dev) } static const struct dev_pm_ops pcie_portdrv_pm_ops = { - .suspend = pcie_port_device_suspend, + SET_SYSTEM_SLEEP_PM_OPS(pcie_port_device_suspend, pcie_port_device_resume) + SET_RUNTIME_PM_OPS(pcie_port_runtime_suspend, + pcie_port_device_runtime_resume, pcie_port_runtime_idle) .resume_noirq = pcie_port_device_resume_noirq, - .resume = pcie_port_device_resume, - .freeze = pcie_port_device_suspend, - .thaw = pcie_port_device_resume, - .poweroff = pcie_port_device_suspend, .restore_noirq = pcie_port_device_resume_noirq, - .restore = pcie_port_device_resume, - .runtime_suspend = pcie_port_runtime_suspend, - .runtime_resume = pcie_port_device_runtime_resume, - .runtime_idle = pcie_port_runtime_idle, }; #define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops) -- 2.25.1