linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	amd-gfx@lists.freedesktop.org
Subject: [PATCH 4/5] PCI: PM: Avoid exporting __pci_complete_power_transition()
Date: Tue, 05 Nov 2019 11:30:36 +0100	[thread overview]
Message-ID: <1731661.ykamz2Tiuf@kreacher> (raw)
In-Reply-To: <2771503.n70vfTtcVb@kreacher>

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Notice that radeon_set_suspend(), which is the only caller of
__pci_complete_power_transition() outside of pci.c, really only
cares about the pci_platform_power_transition() invoked by it,
so export the latter instead of it, update the radeon driver to
call pci_platform_power_transition() directly and make
__pci_complete_power_transition() static.

Code rearrangement, no intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/pci/pci.c                   |    6 +++---
 drivers/video/fbdev/aty/radeon_pm.c |    2 +-
 include/linux/pci.h                 |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Index: linux-pm/drivers/pci/pci.c
===================================================================
--- linux-pm.orig/drivers/pci/pci.c
+++ linux-pm/drivers/pci/pci.c
@@ -963,7 +963,7 @@ void pci_refresh_power_state(struct pci_
  * @dev: PCI device to handle.
  * @state: State to put the device into.
  */
-static int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state)
+int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state)
 {
 	int error;
 
@@ -979,6 +979,7 @@ static int pci_platform_power_transition
 
 	return error;
 }
+EXPORT_SYMBOL_GPL(pci_platform_power_transition);
 
 /**
  * pci_wakeup - Wake up a PCI device
@@ -1061,7 +1062,7 @@ void pci_bus_set_current_state(struct pc
  *
  * This function should not be called directly by device drivers.
  */
-int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state)
+static int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state)
 {
 	int ret;
 
@@ -1073,7 +1074,6 @@ int __pci_complete_power_transition(stru
 		pci_bus_set_current_state(dev->subordinate, PCI_D3cold);
 	return ret;
 }
-EXPORT_SYMBOL_GPL(__pci_complete_power_transition);
 
 /**
  * pci_set_power_state - Set the power state of a PCI device
Index: linux-pm/drivers/video/fbdev/aty/radeon_pm.c
===================================================================
--- linux-pm.orig/drivers/video/fbdev/aty/radeon_pm.c
+++ linux-pm/drivers/video/fbdev/aty/radeon_pm.c
@@ -2593,7 +2593,7 @@ static void radeon_set_suspend(struct ra
 		 * calling pci_set_power_state()
 		 */
 		radeonfb_whack_power_state(rinfo, PCI_D2);
-		__pci_complete_power_transition(rinfo->pdev, PCI_D2);
+		pci_platform_power_transition(rinfo->pdev, PCI_D2);
 	} else {
 		printk(KERN_DEBUG "radeonfb (%s): switching to D0 state...\n",
 		       pci_name(rinfo->pdev));
Index: linux-pm/include/linux/pci.h
===================================================================
--- linux-pm.orig/include/linux/pci.h
+++ linux-pm/include/linux/pci.h
@@ -1232,7 +1232,7 @@ struct pci_cap_saved_state *pci_find_sav
 int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size);
 int pci_add_ext_cap_save_buffer(struct pci_dev *dev,
 				u16 cap, unsigned int size);
-int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state);
+int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state);
 int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
 pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
 bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);




  parent reply	other threads:[~2019-11-05 10:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 10:11 [PATCH 0/5] PCI: PM: Cleanups related to power state changes Rafael J. Wysocki
2019-11-05 10:13 ` [PATCH 1/5] PCI: PM: Move power state update away from pci_power_up() Rafael J. Wysocki
2019-11-05 10:27 ` [PATCH 2/5] PCI: PM: Use pci_power_up() in pci_set_power_state() Rafael J. Wysocki
2019-11-05 10:29 ` [PATCH 3/5] PCI: PM: Fold __pci_start_power_transition() into its caller Rafael J. Wysocki
2019-11-05 10:30 ` Rafael J. Wysocki [this message]
2019-11-05 10:32 ` [PATCH 5/5] PCI: PM: Fold __pci_complete_power_transition() " Rafael J. Wysocki
2019-11-05 16:09   ` Christoph Hellwig
2019-11-05 16:15     ` Rafael J. Wysocki
2019-11-05 11:28 ` [PATCH 0/5] PCI: PM: Cleanups related to power state changes Rafael J. Wysocki
2019-11-05 22:35   ` Bjorn Helgaas
2019-11-05 22:48     ` Rafael J. Wysocki
2019-11-05 13:02 ` Mika Westerberg
2019-11-05 16:32 ` [PATCH update 5/5] PCI: PM: Fold __pci_complete_power_transition() into its caller Rafael J. Wysocki
2019-11-06 19:02 ` [PATCH 0/5] PCI: PM: Cleanups related to power state changes Bjorn Helgaas
2019-11-07 13:33   ` Rafael J. Wysocki
2019-11-08 11:49   ` Rafael J. Wysocki
2019-11-08 20:13     ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1731661.ykamz2Tiuf@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).