Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1284286imm; Fri, 8 Jun 2018 13:16:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIy/MMq3CNosJkJts6/n3uRjLjp18WH3wiedu0UvD3ARiTojgwRteKIz3/qZbz5dE6Iboj8 X-Received: by 2002:a17:902:4301:: with SMTP id i1-v6mr8045029pld.280.1528488970667; Fri, 08 Jun 2018 13:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528488970; cv=none; d=google.com; s=arc-20160816; b=mThBjdgDKZ2TeBiiDDvNESLW/FRkMD2yAiy7j+y5jmlxlkitzMBrDly5Q5bWJdb01C zoXhS0mWYLksRGUfdYnY1Ym1+uSCc3PcPCAjHHwl3nTN106nDj8C3sVNlEwQKHJEMB3D Dk5X9HYaRroPdTsAwn8o6YpsCjfXDX/9T+sFpw+iVJkhuxhaC+q42BAHnWsHw3ImbjRW y/KNQuPtcVj3Nb+YRMO4fqSilmtcyGmTeUIeMtX34nPWaMoncGjKPvPE2hJA4S2mraA+ lZxHeCtHbs5ExYeiJs7g9zhaoPW6lpFXmwT7a9WzkAQ38bGgqrYfQ53mEnAA9mn3ROmL /zmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature:arc-authentication-results; bh=3Pt2lkzDsblJV2W3IitbIkgygiVhdFU6SMPaQbuwfdg=; b=Z0d6qbTP3jlqzUxqfN5Ixvoew7wV27CDe/W7rpBalV3wIpM7xmXL2kmGteuzMl/T+6 q5umzC2VhWrS61ddVttnyWRauh2XxNigxgYl3Jd44928L4IoSeHAzpS81JG7+fjT1EpD xA99xfL0oVXglYzJQbQT4/VDCb7SNuFmjg+nMbUqzPLjTCFNap/NEibInFx7A6UknF+B UKFSEjEh3Vwfgw+Mz5iacqyODMlKxnoszZ/z6iIvrKMs3K+FVjp2mzLG6RKhQguRIUi2 eqSDx+1eCDVt88AXQoxToDe8pxFTYIOzdYPuK67lLX64Ggi4jBA1rThTVZqMAXDHEVsM Zrlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NdgDig1h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v130-v6si19240469pgb.179.2018.06.08.13.15.56; Fri, 08 Jun 2018 13:16:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NdgDig1h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753042AbeFHUMZ (ORCPT + 99 others); Fri, 8 Jun 2018 16:12:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:51370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753006AbeFHUMV (ORCPT ); Fri, 8 Jun 2018 16:12:21 -0400 Received: from localhost (unknown [150.199.191.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 55B7E206B7; Fri, 8 Jun 2018 20:12:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528488740; bh=UyFlL7ZqgKpuL5/QcM/qc7SfCwMF20wWYiwZQ3uqEWI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=NdgDig1hs4iR4ghnAWjO/vv/JPCRCDijkC60AcLZDOd4OVKwCOzrmhpQsQtNIiIrb N26VTT1yI+vkfpsXeb49tGvZVEU3j5T5R6/R7VleyiokKEQ/KS6aJauFvEZy42dRup PBfRinT7WZ3F2bXgYz53XUrFTc5TWHCPvDS4Xl8s= Subject: [PATCH v1 3/9] PCI/portdrv: Squash PM-related code into portdrv_pci.c From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: Oza Pawandeep , linux-kernel@vger.kernel.org Date: Fri, 08 Jun 2018 15:12:19 -0500 Message-ID: <152848873956.14051.11535152653562634346.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <152848853199.14051.12670957565366345798.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <152848853199.14051.12670957565366345798.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas pcie_port_device_suspend() and pcie_port_device_resume() were defined in portdrv_core.c and only used in portdrv_pci.c. Move them there and make them static. No functional change intended. Signed-off-by: Bjorn Helgaas --- drivers/pci/pcie/portdrv.h | 4 --- drivers/pci/pcie/portdrv_core.c | 45 --------------------------------------- drivers/pci/pcie/portdrv_pci.c | 43 +++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 49 deletions(-) diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index 7a2e5f0dfb53..cb2a33ea68a5 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h @@ -79,10 +79,6 @@ void pcie_port_service_unregister(struct pcie_port_service_driver *new); #define get_descriptor_id(type, service) (((type - 4) << 8) | service) extern struct bus_type pcie_port_bus_type; -#ifdef CONFIG_PM -int pcie_port_device_suspend(struct device *dev); -int pcie_port_device_resume(struct device *dev); -#endif void pcie_port_device_remove(struct pci_dev *dev); int __must_check pcie_port_bus_register(void); void pcie_port_bus_unregister(void); diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 747a58d6aaf4..9bcc856738ff 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -25,51 +25,6 @@ struct portdrv_service_data { u32 service; }; -#ifdef CONFIG_PM -static int suspend_iter(struct device *dev, void *data) -{ - struct pcie_port_service_driver *service_driver; - - if ((dev->bus == &pcie_port_bus_type) && dev->driver) { - service_driver = to_service_driver(dev->driver); - if (service_driver->suspend) - service_driver->suspend(to_pcie_device(dev)); - } - return 0; -} - -/** - * pcie_port_device_suspend - suspend port services associated with a PCIe port - * @dev: PCI Express port to handle - */ -int pcie_port_device_suspend(struct device *dev) -{ - return device_for_each_child(dev, NULL, suspend_iter); -} - -static int resume_iter(struct device *dev, void *data) -{ - struct pcie_port_service_driver *service_driver; - - if ((dev->bus == &pcie_port_bus_type) && - (dev->driver)) { - service_driver = to_service_driver(dev->driver); - if (service_driver->resume) - service_driver->resume(to_pcie_device(dev)); - } - return 0; -} - -/** - * pcie_port_device_resume - resume port services associated with a PCIe port - * @dev: PCI Express port to handle - */ -int pcie_port_device_resume(struct device *dev) -{ - return device_for_each_child(dev, NULL, resume_iter); -} -#endif /* PM */ - static int remove_iter(struct device *dev, void *data) { if (dev->bus == &pcie_port_bus_type) diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 08c605734d98..1b7855a062ff 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c @@ -54,6 +54,49 @@ static int pcie_portdrv_restore_config(struct pci_dev *dev) } #ifdef CONFIG_PM +static int suspend_iter(struct device *dev, void *data) +{ + struct pcie_port_service_driver *service_driver; + + if ((dev->bus == &pcie_port_bus_type) && dev->driver) { + service_driver = to_service_driver(dev->driver); + if (service_driver->suspend) + service_driver->suspend(to_pcie_device(dev)); + } + return 0; +} + +/** + * pcie_port_device_suspend - suspend port services associated with a PCIe port + * @dev: PCI Express port to handle + */ +static int pcie_port_device_suspend(struct device *dev) +{ + return device_for_each_child(dev, NULL, suspend_iter); +} + +static int resume_iter(struct device *dev, void *data) +{ + struct pcie_port_service_driver *service_driver; + + if ((dev->bus == &pcie_port_bus_type) && + (dev->driver)) { + service_driver = to_service_driver(dev->driver); + if (service_driver->resume) + service_driver->resume(to_pcie_device(dev)); + } + return 0; +} + +/** + * pcie_port_device_resume - resume port services associated with a PCIe port + * @dev: PCI Express port to handle + */ +static int pcie_port_device_resume(struct device *dev) +{ + return device_for_each_child(dev, NULL, resume_iter); +} + static int pcie_port_runtime_suspend(struct device *dev) { return to_pci_dev(dev)->bridge_d3 ? 0 : -EBUSY;