[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200525182608.1823735-3-kw@linux.com>
Date: Mon, 25 May 2020 18:26:02 +0000
From: Krzysztof Wilczyński <kw@...ux.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>, Kevin Hilman <khilman@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
Pavel Machek <pavel@....cz>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Johan Hovold <johan@...nel.org>, Alex Elder <elder@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Felipe Balbi <balbi@...nel.org>,
Julian Wiedmann <jwi@...ux.ibm.com>,
Karsten Graul <kgraul@...ux.ibm.com>,
Ursula Braun <ubraun@...ux.ibm.com>,
Jakub Kicinski <kuba@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
John Stultz <john.stultz@...aro.org>,
"David S. Miller" <davem@...emloft.net>,
greybus-dev@...ts.linaro.org, netdev@...r.kernel.org,
linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org,
linux-pm@...r.kernel.org, linux-s390@...r.kernel.org,
linux-scsi@...r.kernel.org, linux-usb@...r.kernel.org
Subject: [PATCH 2/8] ACPI: PM: Use the new device_to_pm() helper to access struct dev_pm_ops
Use the new device_to_pm() helper to access Power Management callbacs
(struct dev_pm_ops) for a particular device (struct device_driver).
No functional change intended.
Signed-off-by: Krzysztof Wilczyński <kw@...ux.com>
---
drivers/acpi/device_pm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 5832bc10aca8..b98a32c48fbe 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -1022,9 +1022,10 @@ static bool acpi_dev_needs_resume(struct device *dev, struct acpi_device *adev)
int acpi_subsys_prepare(struct device *dev)
{
struct acpi_device *adev = ACPI_COMPANION(dev);
+ const struct dev_pm_ops *pm = driver_to_pm(dev->driver);
- if (dev->driver && dev->driver->pm && dev->driver->pm->prepare) {
- int ret = dev->driver->pm->prepare(dev);
+ if (pm && pm->prepare) {
+ int ret = pm->prepare(dev);
if (ret < 0)
return ret;
--
2.26.2
Powered by blists - more mailing lists