diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/platform.c | 38 | ||||
-rw-r--r-- | drivers/base/power/main.c | 8 | ||||
-rw-r--r-- | drivers/dma/dw_dmac.c | 15 | ||||
-rw-r--r-- | drivers/dma/txx9dmac.c | 15 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 25 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 25 | ||||
-rw-r--r-- | drivers/pci/pci-driver.c | 16 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.c | 18 |
8 files changed, 79 insertions, 81 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 81cb01bfc356..ae5c4aa6d269 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -628,30 +628,6 @@ static int platform_legacy_suspend(struct device *dev, pm_message_t mesg) | |||
628 | return ret; | 628 | return ret; |
629 | } | 629 | } |
630 | 630 | ||
631 | static int platform_legacy_suspend_late(struct device *dev, pm_message_t mesg) | ||
632 | { | ||
633 | struct platform_driver *pdrv = to_platform_driver(dev->driver); | ||
634 | struct platform_device *pdev = to_platform_device(dev); | ||
635 | int ret = 0; | ||
636 | |||
637 | if (dev->driver && pdrv->suspend_late) | ||
638 | ret = pdrv->suspend_late(pdev, mesg); | ||
639 | |||
640 | return ret; | ||
641 | } | ||
642 | |||
643 | static int platform_legacy_resume_early(struct device *dev) | ||
644 | { | ||
645 | struct platform_driver *pdrv = to_platform_driver(dev->driver); | ||
646 | struct platform_device *pdev = to_platform_device(dev); | ||
647 | int ret = 0; | ||
648 | |||
649 | if (dev->driver && pdrv->resume_early) | ||
650 | ret = pdrv->resume_early(pdev); | ||
651 | |||
652 | return ret; | ||
653 | } | ||
654 | |||
655 | static int platform_legacy_resume(struct device *dev) | 631 | static int platform_legacy_resume(struct device *dev) |
656 | { | 632 | { |
657 | struct platform_driver *pdrv = to_platform_driver(dev->driver); | 633 | struct platform_driver *pdrv = to_platform_driver(dev->driver); |
@@ -714,8 +690,6 @@ static int platform_pm_suspend_noirq(struct device *dev) | |||
714 | if (drv->pm) { | 690 | if (drv->pm) { |
715 | if (drv->pm->suspend_noirq) | 691 | if (drv->pm->suspend_noirq) |
716 | ret = drv->pm->suspend_noirq(dev); | 692 | ret = drv->pm->suspend_noirq(dev); |
717 | } else { | ||
718 | ret = platform_legacy_suspend_late(dev, PMSG_SUSPEND); | ||
719 | } | 693 | } |
720 | 694 | ||
721 | return ret; | 695 | return ret; |
@@ -750,8 +724,6 @@ static int platform_pm_resume_noirq(struct device *dev) | |||
750 | if (drv->pm) { | 724 | if (drv->pm) { |
751 | if (drv->pm->resume_noirq) | 725 | if (drv->pm->resume_noirq) |
752 | ret = drv->pm->resume_noirq(dev); | 726 | ret = drv->pm->resume_noirq(dev); |
753 | } else { | ||
754 | ret = platform_legacy_resume_early(dev); | ||
755 | } | 727 | } |
756 | 728 | ||
757 | return ret; | 729 | return ret; |
@@ -797,8 +769,6 @@ static int platform_pm_freeze_noirq(struct device *dev) | |||
797 | if (drv->pm) { | 769 | if (drv->pm) { |
798 | if (drv->pm->freeze_noirq) | 770 | if (drv->pm->freeze_noirq) |
799 | ret = drv->pm->freeze_noirq(dev); | 771 | ret = drv->pm->freeze_noirq(dev); |
800 | } else { | ||
801 | ret = platform_legacy_suspend_late(dev, PMSG_FREEZE); | ||
802 | } | 772 | } |
803 | 773 | ||
804 | return ret; | 774 | return ret; |
@@ -833,8 +803,6 @@ static int platform_pm_thaw_noirq(struct device *dev) | |||
833 | if (drv->pm) { | 803 | if (drv->pm) { |
834 | if (drv->pm->thaw_noirq) | 804 | if (drv->pm->thaw_noirq) |
835 | ret = drv->pm->thaw_noirq(dev); | 805 | ret = drv->pm->thaw_noirq(dev); |
836 | } else { | ||
837 | ret = platform_legacy_resume_early(dev); | ||
838 | } | 806 | } |
839 | 807 | ||
840 | return ret; | 808 | return ret; |
@@ -869,8 +837,6 @@ static int platform_pm_poweroff_noirq(struct device *dev) | |||
869 | if (drv->pm) { | 837 | if (drv->pm) { |
870 | if (drv->pm->poweroff_noirq) | 838 | if (drv->pm->poweroff_noirq) |
871 | ret = drv->pm->poweroff_noirq(dev); | 839 | ret = drv->pm->poweroff_noirq(dev); |
872 | } else { | ||
873 | ret = platform_legacy_suspend_late(dev, PMSG_HIBERNATE); | ||
874 | } | 840 | } |
875 | 841 | ||
876 | return ret; | 842 | return ret; |
@@ -905,8 +871,6 @@ static int platform_pm_restore_noirq(struct device *dev) | |||
905 | if (drv->pm) { | 871 | if (drv->pm) { |
906 | if (drv->pm->restore_noirq) | 872 | if (drv->pm->restore_noirq) |
907 | ret = drv->pm->restore_noirq(dev); | 873 | ret = drv->pm->restore_noirq(dev); |
908 | } else { | ||
909 | ret = platform_legacy_resume_early(dev); | ||
910 | } | 874 | } |
911 | 875 | ||
912 | return ret; | 876 | return ret; |
@@ -925,7 +889,7 @@ static int platform_pm_restore_noirq(struct device *dev) | |||
925 | 889 | ||
926 | #endif /* !CONFIG_HIBERNATION */ | 890 | #endif /* !CONFIG_HIBERNATION */ |
927 | 891 | ||
928 | static struct dev_pm_ops platform_dev_pm_ops = { | 892 | static const struct dev_pm_ops platform_dev_pm_ops = { |
929 | .prepare = platform_pm_prepare, | 893 | .prepare = platform_pm_prepare, |
930 | .complete = platform_pm_complete, | 894 | .complete = platform_pm_complete, |
931 | .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/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 98c9a847bf51..933c143b6a74 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c | |||
@@ -1399,8 +1399,9 @@ static void dw_shutdown(struct platform_device *pdev) | |||
1399 | clk_disable(dw->clk); | 1399 | clk_disable(dw->clk); |
1400 | } | 1400 | } |
1401 | 1401 | ||
1402 | static int dw_suspend_late(struct platform_device *pdev, pm_message_t mesg) | 1402 | static int dw_suspend_noirq(struct device *dev) |
1403 | { | 1403 | { |
1404 | struct platform_device *pdev = to_platform_device(dev); | ||
1404 | struct dw_dma *dw = platform_get_drvdata(pdev); | 1405 | struct dw_dma *dw = platform_get_drvdata(pdev); |
1405 | 1406 | ||
1406 | dw_dma_off(platform_get_drvdata(pdev)); | 1407 | dw_dma_off(platform_get_drvdata(pdev)); |
@@ -1408,23 +1409,27 @@ static int dw_suspend_late(struct platform_device *pdev, pm_message_t mesg) | |||
1408 | return 0; | 1409 | return 0; |
1409 | } | 1410 | } |
1410 | 1411 | ||
1411 | static int dw_resume_early(struct platform_device *pdev) | 1412 | static int dw_resume_noirq(struct device *dev) |
1412 | { | 1413 | { |
1414 | struct platform_device *pdev = to_platform_device(dev); | ||
1413 | struct dw_dma *dw = platform_get_drvdata(pdev); | 1415 | struct dw_dma *dw = platform_get_drvdata(pdev); |
1414 | 1416 | ||
1415 | clk_enable(dw->clk); | 1417 | clk_enable(dw->clk); |
1416 | dma_writel(dw, CFG, DW_CFG_DMA_EN); | 1418 | dma_writel(dw, CFG, DW_CFG_DMA_EN); |
1417 | return 0; | 1419 | return 0; |
1418 | |||
1419 | } | 1420 | } |
1420 | 1421 | ||
1422 | static struct dev_pm_ops dw_dev_pm_ops = { | ||
1423 | .suspend_noirq = dw_suspend_noirq, | ||
1424 | .resume_noirq = dw_resume_noirq, | ||
1425 | }; | ||
1426 | |||
1421 | static struct platform_driver dw_driver = { | 1427 | static struct platform_driver dw_driver = { |
1422 | .remove = __exit_p(dw_remove), | 1428 | .remove = __exit_p(dw_remove), |
1423 | .shutdown = dw_shutdown, | 1429 | .shutdown = dw_shutdown, |
1424 | .suspend_late = dw_suspend_late, | ||
1425 | .resume_early = dw_resume_early, | ||
1426 | .driver = { | 1430 | .driver = { |
1427 | .name = "dw_dmac", | 1431 | .name = "dw_dmac", |
1432 | .pm = &dw_dev_pm_ops, | ||
1428 | }, | 1433 | }, |
1429 | }; | 1434 | }; |
1430 | 1435 | ||
diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c index 88dab52926f4..7837930146a4 100644 --- a/drivers/dma/txx9dmac.c +++ b/drivers/dma/txx9dmac.c | |||
@@ -1291,17 +1291,18 @@ static void txx9dmac_shutdown(struct platform_device *pdev) | |||
1291 | txx9dmac_off(ddev); | 1291 | txx9dmac_off(ddev); |
1292 | } | 1292 | } |
1293 | 1293 | ||
1294 | static int txx9dmac_suspend_late(struct platform_device *pdev, | 1294 | static int txx9dmac_suspend_noirq(struct device *dev) |
1295 | pm_message_t mesg) | ||
1296 | { | 1295 | { |
1296 | struct platform_device *pdev = to_platform_device(dev); | ||
1297 | struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); | 1297 | struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); |
1298 | 1298 | ||
1299 | txx9dmac_off(ddev); | 1299 | txx9dmac_off(ddev); |
1300 | return 0; | 1300 | return 0; |
1301 | } | 1301 | } |
1302 | 1302 | ||
1303 | static int txx9dmac_resume_early(struct platform_device *pdev) | 1303 | static int txx9dmac_resume_noirq(struct device *dev) |
1304 | { | 1304 | { |
1305 | struct platform_device *pdev = to_platform_device(dev); | ||
1305 | struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); | 1306 | struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); |
1306 | struct txx9dmac_platform_data *pdata = pdev->dev.platform_data; | 1307 | struct txx9dmac_platform_data *pdata = pdev->dev.platform_data; |
1307 | u32 mcr; | 1308 | u32 mcr; |
@@ -1314,6 +1315,11 @@ static int txx9dmac_resume_early(struct platform_device *pdev) | |||
1314 | 1315 | ||
1315 | } | 1316 | } |
1316 | 1317 | ||
1318 | static struct dev_pm_ops txx9dmac_dev_pm_ops = { | ||
1319 | .suspend_noirq = txx9dmac_suspend_noirq, | ||
1320 | .resume_noirq = txx9dmac_resume_noirq, | ||
1321 | }; | ||
1322 | |||
1317 | static struct platform_driver txx9dmac_chan_driver = { | 1323 | static struct platform_driver txx9dmac_chan_driver = { |
1318 | .remove = __exit_p(txx9dmac_chan_remove), | 1324 | .remove = __exit_p(txx9dmac_chan_remove), |
1319 | .driver = { | 1325 | .driver = { |
@@ -1324,10 +1330,9 @@ static struct platform_driver txx9dmac_chan_driver = { | |||
1324 | static struct platform_driver txx9dmac_driver = { | 1330 | static struct platform_driver txx9dmac_driver = { |
1325 | .remove = __exit_p(txx9dmac_remove), | 1331 | .remove = __exit_p(txx9dmac_remove), |
1326 | .shutdown = txx9dmac_shutdown, | 1332 | .shutdown = txx9dmac_shutdown, |
1327 | .suspend_late = txx9dmac_suspend_late, | ||
1328 | .resume_early = txx9dmac_resume_early, | ||
1329 | .driver = { | 1333 | .driver = { |
1330 | .name = "txx9dmac", | 1334 | .name = "txx9dmac", |
1335 | .pm = &txx9dmac_dev_pm_ops, | ||
1331 | }, | 1336 | }, |
1332 | }; | 1337 | }; |
1333 | 1338 | ||
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 762e1e530882..049555777f67 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -1134,35 +1134,44 @@ static int __exit i2c_pxa_remove(struct platform_device *dev) | |||
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | #ifdef CONFIG_PM | 1136 | #ifdef CONFIG_PM |
1137 | static int i2c_pxa_suspend_late(struct platform_device *dev, pm_message_t state) | 1137 | static int i2c_pxa_suspend_noirq(struct device *dev) |
1138 | { | 1138 | { |
1139 | struct pxa_i2c *i2c = platform_get_drvdata(dev); | 1139 | struct platform_device *pdev = to_platform_device(dev); |
1140 | struct pxa_i2c *i2c = platform_get_drvdata(pdev); | ||
1141 | |||
1140 | clk_disable(i2c->clk); | 1142 | clk_disable(i2c->clk); |
1143 | |||
1141 | return 0; | 1144 | return 0; |
1142 | } | 1145 | } |
1143 | 1146 | ||
1144 | static int i2c_pxa_resume_early(struct platform_device *dev) | 1147 | static int i2c_pxa_resume_noirq(struct device *dev) |
1145 | { | 1148 | { |
1146 | struct pxa_i2c *i2c = platform_get_drvdata(dev); | 1149 | struct platform_device *pdev = to_platform_device(dev); |
1150 | struct pxa_i2c *i2c = platform_get_drvdata(pdev); | ||
1147 | 1151 | ||
1148 | clk_enable(i2c->clk); | 1152 | clk_enable(i2c->clk); |
1149 | i2c_pxa_reset(i2c); | 1153 | i2c_pxa_reset(i2c); |
1150 | 1154 | ||
1151 | return 0; | 1155 | return 0; |
1152 | } | 1156 | } |
1157 | |||
1158 | static struct dev_pm_ops i2c_pxa_dev_pm_ops = { | ||
1159 | .suspend_noirq = i2c_pxa_suspend_noirq, | ||
1160 | .resume_noirq = i2c_pxa_resume_noirq, | ||
1161 | }; | ||
1162 | |||
1163 | #define I2C_PXA_DEV_PM_OPS (&i2c_pxa_dev_pm_ops) | ||
1153 | #else | 1164 | #else |
1154 | #define i2c_pxa_suspend_late NULL | 1165 | #define I2C_PXA_DEV_PM_OPS NULL |
1155 | #define i2c_pxa_resume_early NULL | ||
1156 | #endif | 1166 | #endif |
1157 | 1167 | ||
1158 | static struct platform_driver i2c_pxa_driver = { | 1168 | static struct platform_driver i2c_pxa_driver = { |
1159 | .probe = i2c_pxa_probe, | 1169 | .probe = i2c_pxa_probe, |
1160 | .remove = __exit_p(i2c_pxa_remove), | 1170 | .remove = __exit_p(i2c_pxa_remove), |
1161 | .suspend_late = i2c_pxa_suspend_late, | ||
1162 | .resume_early = i2c_pxa_resume_early, | ||
1163 | .driver = { | 1171 | .driver = { |
1164 | .name = "pxa2xx-i2c", | 1172 | .name = "pxa2xx-i2c", |
1165 | .owner = THIS_MODULE, | 1173 | .owner = THIS_MODULE, |
1174 | .pm = I2C_PXA_DEV_PM_OPS, | ||
1166 | }, | 1175 | }, |
1167 | .id_table = i2c_pxa_id_table, | 1176 | .id_table = i2c_pxa_id_table, |
1168 | }; | 1177 | }; |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 8f42a4536cdf..3be0d6a4d630 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -951,17 +951,20 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) | |||
951 | } | 951 | } |
952 | 952 | ||
953 | #ifdef CONFIG_PM | 953 | #ifdef CONFIG_PM |
954 | static int s3c24xx_i2c_suspend_late(struct platform_device *dev, | 954 | static int s3c24xx_i2c_suspend_noirq(struct device *dev) |
955 | pm_message_t msg) | ||
956 | { | 955 | { |
957 | struct s3c24xx_i2c *i2c = platform_get_drvdata(dev); | 956 | struct platform_device *pdev = to_platform_device(dev); |
957 | struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); | ||
958 | |||
958 | i2c->suspended = 1; | 959 | i2c->suspended = 1; |
960 | |||
959 | return 0; | 961 | return 0; |
960 | } | 962 | } |
961 | 963 | ||
962 | static int s3c24xx_i2c_resume(struct platform_device *dev) | 964 | static int s3c24xx_i2c_resume(struct device *dev) |
963 | { | 965 | { |
964 | struct s3c24xx_i2c *i2c = platform_get_drvdata(dev); | 966 | struct platform_device *pdev = to_platform_device(dev); |
967 | struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); | ||
965 | 968 | ||
966 | i2c->suspended = 0; | 969 | i2c->suspended = 0; |
967 | s3c24xx_i2c_init(i2c); | 970 | s3c24xx_i2c_init(i2c); |
@@ -969,9 +972,14 @@ static int s3c24xx_i2c_resume(struct platform_device *dev) | |||
969 | return 0; | 972 | return 0; |
970 | } | 973 | } |
971 | 974 | ||
975 | static struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = { | ||
976 | .suspend_noirq = s3c24xx_i2c_suspend_noirq, | ||
977 | .resume = s3c24xx_i2c_resume, | ||
978 | }; | ||
979 | |||
980 | #define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops) | ||
972 | #else | 981 | #else |
973 | #define s3c24xx_i2c_suspend_late NULL | 982 | #define S3C24XX_DEV_PM_OPS NULL |
974 | #define s3c24xx_i2c_resume NULL | ||
975 | #endif | 983 | #endif |
976 | 984 | ||
977 | /* device driver for platform bus bits */ | 985 | /* device driver for platform bus bits */ |
@@ -990,12 +998,11 @@ MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids); | |||
990 | static struct platform_driver s3c24xx_i2c_driver = { | 998 | static struct platform_driver s3c24xx_i2c_driver = { |
991 | .probe = s3c24xx_i2c_probe, | 999 | .probe = s3c24xx_i2c_probe, |
992 | .remove = s3c24xx_i2c_remove, | 1000 | .remove = s3c24xx_i2c_remove, |
993 | .suspend_late = s3c24xx_i2c_suspend_late, | ||
994 | .resume = s3c24xx_i2c_resume, | ||
995 | .id_table = s3c24xx_driver_ids, | 1001 | .id_table = s3c24xx_driver_ids, |
996 | .driver = { | 1002 | .driver = { |
997 | .owner = THIS_MODULE, | 1003 | .owner = THIS_MODULE, |
998 | .name = "s3c-i2c", | 1004 | .name = "s3c-i2c", |
1005 | .pm = S3C24XX_DEV_PM_OPS, | ||
999 | }, | 1006 | }, |
1000 | }; | 1007 | }; |
1001 | 1008 | ||
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, |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 554a414f65d1..1191928902f4 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -2168,8 +2168,9 @@ static int __devexit musb_remove(struct platform_device *pdev) | |||
2168 | 2168 | ||
2169 | #ifdef CONFIG_PM | 2169 | #ifdef CONFIG_PM |
2170 | 2170 | ||
2171 | static int musb_suspend(struct platform_device *pdev, pm_message_t message) | 2171 | static int musb_suspend(struct device *dev) |
2172 | { | 2172 | { |
2173 | struct platform_device *pdev = to_platform_device(dev); | ||
2173 | unsigned long flags; | 2174 | unsigned long flags; |
2174 | struct musb *musb = dev_to_musb(&pdev->dev); | 2175 | struct musb *musb = dev_to_musb(&pdev->dev); |
2175 | 2176 | ||
@@ -2196,8 +2197,9 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message) | |||
2196 | return 0; | 2197 | return 0; |
2197 | } | 2198 | } |
2198 | 2199 | ||
2199 | static int musb_resume_early(struct platform_device *pdev) | 2200 | static int musb_resume_noirq(struct device *dev) |
2200 | { | 2201 | { |
2202 | struct platform_device *pdev = to_platform_device(dev); | ||
2201 | struct musb *musb = dev_to_musb(&pdev->dev); | 2203 | struct musb *musb = dev_to_musb(&pdev->dev); |
2202 | 2204 | ||
2203 | if (!musb->clock) | 2205 | if (!musb->clock) |
@@ -2215,9 +2217,14 @@ static int musb_resume_early(struct platform_device *pdev) | |||
2215 | return 0; | 2217 | return 0; |
2216 | } | 2218 | } |
2217 | 2219 | ||
2220 | static struct dev_pm_ops musb_dev_pm_ops = { | ||
2221 | .suspend = musb_suspend, | ||
2222 | .resume_noirq = musb_resume_noirq, | ||
2223 | }; | ||
2224 | |||
2225 | #define MUSB_DEV_PM_OPS (&musb_dev_pm_ops) | ||
2218 | #else | 2226 | #else |
2219 | #define musb_suspend NULL | 2227 | #define MUSB_DEV_PM_OPS NULL |
2220 | #define musb_resume_early NULL | ||
2221 | #endif | 2228 | #endif |
2222 | 2229 | ||
2223 | static struct platform_driver musb_driver = { | 2230 | static struct platform_driver musb_driver = { |
@@ -2225,11 +2232,10 @@ static struct platform_driver musb_driver = { | |||
2225 | .name = (char *)musb_driver_name, | 2232 | .name = (char *)musb_driver_name, |
2226 | .bus = &platform_bus_type, | 2233 | .bus = &platform_bus_type, |
2227 | .owner = THIS_MODULE, | 2234 | .owner = THIS_MODULE, |
2235 | .pm = MUSB_DEV_PM_OPS, | ||
2228 | }, | 2236 | }, |
2229 | .remove = __devexit_p(musb_remove), | 2237 | .remove = __devexit_p(musb_remove), |
2230 | .shutdown = musb_shutdown, | 2238 | .shutdown = musb_shutdown, |
2231 | .suspend = musb_suspend, | ||
2232 | .resume_early = musb_resume_early, | ||
2233 | }; | 2239 | }; |
2234 | 2240 | ||
2235 | /*-------------------------------------------------------------------------*/ | 2241 | /*-------------------------------------------------------------------------*/ |