[PATCH 3/8] greybus: Use the new device_to_pm() helper to access struct dev_pm_ops

From
Krzysztof Wilczyński <hidden>
Date
2020-05-25 18:26:45
Also in
linux-acpi, linux-pci, linux-pm, linux-s390, linux-scsi, netdev
Reply to
Krzysztof Wilczyński, 2020-05-25
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 <redacted>
---
 drivers/greybus/bundle.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/greybus/bundle.c b/drivers/greybus/bundle.c
index 84660729538b..d38d3a630812 100644
--- a/drivers/greybus/bundle.c
+++ b/drivers/greybus/bundle.c
@@ -108,7 +108,7 @@ static void gb_bundle_enable_all_connections(struct gb_bundle *bundle)
 static int gb_bundle_suspend(struct device *dev)
 {
 	struct gb_bundle *bundle = to_gb_bundle(dev);
-	const struct dev_pm_ops *pm = dev->driver->pm;
+	const struct dev_pm_ops *pm = driver_to_pm(dev->driver);
 	int ret;
 
 	if (pm && pm->runtime_suspend) {
@@ -135,7 +135,7 @@ static int gb_bundle_suspend(struct device *dev)
 static int gb_bundle_resume(struct device *dev)
 {
 	struct gb_bundle *bundle = to_gb_bundle(dev);
-	const struct dev_pm_ops *pm = dev->driver->pm;
+	const struct dev_pm_ops *pm = driver_to_pm(dev->driver);
 	int ret;
 
 	ret = gb_control_bundle_resume(bundle->intf->control, bundle->id);
-- 
2.26.2
Thread (26 messages) 26 messages, 7 authors, last reply 2020-05-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help