diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/platform.c | 2 | ||||
-rw-r--r-- | drivers/base/power/main.c | 8 | ||||
-rw-r--r-- | drivers/pci/pci-driver.c | 16 |
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 | ||
892 | static struct dev_pm_ops platform_dev_pm_ops = { | 892 | static 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 | */ |
160 | static int pm_op(struct device *dev, struct dev_pm_ops *ops, | 160 | static 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 | */ |
223 | static int pm_noirq_op(struct device *dev, struct dev_pm_ops *ops, | 224 | static 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) | |||
575 | static int pci_pm_suspend(struct device *dev) | 575 | static 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) | |||
613 | static int pci_pm_suspend_noirq(struct device *dev) | 613 | static 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) | |||
672 | static int pci_pm_resume(struct device *dev) | 672 | static 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) | |||
711 | static int pci_pm_freeze(struct device *dev) | 711 | static 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) | |||
780 | static int pci_pm_thaw(struct device *dev) | 780 | static 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) | |||
799 | static int pci_pm_poweroff(struct device *dev) | 799 | static 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) | |||
872 | static int pci_pm_restore(struct device *dev) | 872 | static 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 | ||
913 | struct dev_pm_ops pci_dev_pm_ops = { | 913 | const 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, |