aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/platform.c2
-rw-r--r--drivers/base/power/main.c8
-rw-r--r--drivers/pci/pci-driver.c16
3 files changed, 14 insertions, 12 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 455e55971d0e..ae5c4aa6d269 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -889,7 +889,7 @@ static int platform_pm_restore_noirq(struct device *dev)
889 889
890#endif /* !CONFIG_HIBERNATION */ 890#endif /* !CONFIG_HIBERNATION */
891 891
892static struct dev_pm_ops platform_dev_pm_ops = { 892static const struct dev_pm_ops platform_dev_pm_ops = {
893 .prepare = platform_pm_prepare, 893 .prepare = platform_pm_prepare,
894 .complete = platform_pm_complete, 894 .complete = platform_pm_complete,
895 .suspend = platform_pm_suspend, 895 .suspend = platform_pm_suspend,
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 58a3e572f2c9..1b1a786b7dec 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -157,8 +157,9 @@ void device_pm_move_last(struct device *dev)
157 * @ops: PM operations to choose from. 157 * @ops: PM operations to choose from.
158 * @state: PM transition of the system being carried out. 158 * @state: PM transition of the system being carried out.
159 */ 159 */
160static int pm_op(struct device *dev, struct dev_pm_ops *ops, 160static int pm_op(struct device *dev,
161 pm_message_t state) 161 const struct dev_pm_ops *ops,
162 pm_message_t state)
162{ 163{
163 int error = 0; 164 int error = 0;
164 165
@@ -220,7 +221,8 @@ static int pm_op(struct device *dev, struct dev_pm_ops *ops,
220 * The operation is executed with interrupts disabled by the only remaining 221 * The operation is executed with interrupts disabled by the only remaining
221 * functional CPU in the system. 222 * functional CPU in the system.
222 */ 223 */
223static int pm_noirq_op(struct device *dev, struct dev_pm_ops *ops, 224static int pm_noirq_op(struct device *dev,
225 const struct dev_pm_ops *ops,
224 pm_message_t state) 226 pm_message_t state)
225{ 227{
226 int error = 0; 228 int error = 0;
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index d76c4c85367e..0c2ea44ae5e1 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -575,7 +575,7 @@ static void pci_pm_complete(struct device *dev)
575static int pci_pm_suspend(struct device *dev) 575static int pci_pm_suspend(struct device *dev)
576{ 576{
577 struct pci_dev *pci_dev = to_pci_dev(dev); 577 struct pci_dev *pci_dev = to_pci_dev(dev);
578 struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 578 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
579 579
580 if (pci_has_legacy_pm_support(pci_dev)) 580 if (pci_has_legacy_pm_support(pci_dev))
581 return pci_legacy_suspend(dev, PMSG_SUSPEND); 581 return pci_legacy_suspend(dev, PMSG_SUSPEND);
@@ -613,7 +613,7 @@ static int pci_pm_suspend(struct device *dev)
613static int pci_pm_suspend_noirq(struct device *dev) 613static int pci_pm_suspend_noirq(struct device *dev)
614{ 614{
615 struct pci_dev *pci_dev = to_pci_dev(dev); 615 struct pci_dev *pci_dev = to_pci_dev(dev);
616 struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 616 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
617 617
618 if (pci_has_legacy_pm_support(pci_dev)) 618 if (pci_has_legacy_pm_support(pci_dev))
619 return pci_legacy_suspend_late(dev, PMSG_SUSPEND); 619 return pci_legacy_suspend_late(dev, PMSG_SUSPEND);
@@ -672,7 +672,7 @@ static int pci_pm_resume_noirq(struct device *dev)
672static int pci_pm_resume(struct device *dev) 672static int pci_pm_resume(struct device *dev)
673{ 673{
674 struct pci_dev *pci_dev = to_pci_dev(dev); 674 struct pci_dev *pci_dev = to_pci_dev(dev);
675 struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 675 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
676 int error = 0; 676 int error = 0;
677 677
678 /* 678 /*
@@ -711,7 +711,7 @@ static int pci_pm_resume(struct device *dev)
711static int pci_pm_freeze(struct device *dev) 711static int pci_pm_freeze(struct device *dev)
712{ 712{
713 struct pci_dev *pci_dev = to_pci_dev(dev); 713 struct pci_dev *pci_dev = to_pci_dev(dev);
714 struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 714 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
715 715
716 if (pci_has_legacy_pm_support(pci_dev)) 716 if (pci_has_legacy_pm_support(pci_dev))
717 return pci_legacy_suspend(dev, PMSG_FREEZE); 717 return pci_legacy_suspend(dev, PMSG_FREEZE);
@@ -780,7 +780,7 @@ static int pci_pm_thaw_noirq(struct device *dev)
780static int pci_pm_thaw(struct device *dev) 780static int pci_pm_thaw(struct device *dev)
781{ 781{
782 struct pci_dev *pci_dev = to_pci_dev(dev); 782 struct pci_dev *pci_dev = to_pci_dev(dev);
783 struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 783 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
784 int error = 0; 784 int error = 0;
785 785
786 if (pci_has_legacy_pm_support(pci_dev)) 786 if (pci_has_legacy_pm_support(pci_dev))
@@ -799,7 +799,7 @@ static int pci_pm_thaw(struct device *dev)
799static int pci_pm_poweroff(struct device *dev) 799static int pci_pm_poweroff(struct device *dev)
800{ 800{
801 struct pci_dev *pci_dev = to_pci_dev(dev); 801 struct pci_dev *pci_dev = to_pci_dev(dev);
802 struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 802 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
803 803
804 if (pci_has_legacy_pm_support(pci_dev)) 804 if (pci_has_legacy_pm_support(pci_dev))
805 return pci_legacy_suspend(dev, PMSG_HIBERNATE); 805 return pci_legacy_suspend(dev, PMSG_HIBERNATE);
@@ -872,7 +872,7 @@ static int pci_pm_restore_noirq(struct device *dev)
872static int pci_pm_restore(struct device *dev) 872static int pci_pm_restore(struct device *dev)
873{ 873{
874 struct pci_dev *pci_dev = to_pci_dev(dev); 874 struct pci_dev *pci_dev = to_pci_dev(dev);
875 struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; 875 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
876 int error = 0; 876 int error = 0;
877 877
878 /* 878 /*
@@ -910,7 +910,7 @@ static int pci_pm_restore(struct device *dev)
910 910
911#endif /* !CONFIG_HIBERNATION */ 911#endif /* !CONFIG_HIBERNATION */
912 912
913struct dev_pm_ops pci_dev_pm_ops = { 913const struct dev_pm_ops pci_dev_pm_ops = {
914 .prepare = pci_pm_prepare, 914 .prepare = pci_pm_prepare,
915 .complete = pci_pm_complete, 915 .complete = pci_pm_complete,
916 .suspend = pci_pm_suspend, 916 .suspend = pci_pm_suspend,