diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-12-03 18:34:11 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-12-03 18:51:30 -0500 |
commit | 6ed23b806e73bdd5b17722df507b0f4570c606b6 (patch) | |
tree | 6c03cc156649f8d15eb301a7d86cce3c4840f0a4 | |
parent | a1518d3bbc15d89ccf33056ffa8b3a63de118d24 (diff) |
PM: Merge the SET*_RUNTIME_PM_OPS() macros
The SET_PM_RUNTIME_PM_OPS() and SET_RUNTIME_PM_OPS() macros are
identical except that one of them is not empty for CONFIG_PM set,
while the other one is not empty for CONFIG_PM_RUNTIME set,
respectively.
However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so one
of these macros is now redundant.
For this reason, replace SET_PM_RUNTIME_PM_OPS() with
SET_RUNTIME_PM_OPS() everywhere and redefine the SET_PM_RUNTIME_PM_OPS
symbol as SET_RUNTIME_PM_OPS in case new code is starting to use the
macro being removed here.
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/amba/bus.c | 2 | ||||
-rw-r--r-- | drivers/dma/ste_dma40.c | 2 | ||||
-rw-r--r-- | drivers/gpio/gpio-zynq.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-hix5hd2.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-nomadik.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/mmci.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-pl022.c | 2 | ||||
-rw-r--r-- | include/linux/pm.h | 11 |
10 files changed, 11 insertions, 18 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 47bbdc1b5be3..973a3332a85f 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -124,7 +124,7 @@ static const struct dev_pm_ops amba_pm = { | |||
124 | .thaw = pm_generic_thaw, | 124 | .thaw = pm_generic_thaw, |
125 | .poweroff = pm_generic_poweroff, | 125 | .poweroff = pm_generic_poweroff, |
126 | .restore = pm_generic_restore, | 126 | .restore = pm_generic_restore, |
127 | SET_PM_RUNTIME_PM_OPS( | 127 | SET_RUNTIME_PM_OPS( |
128 | amba_pm_runtime_suspend, | 128 | amba_pm_runtime_suspend, |
129 | amba_pm_runtime_resume, | 129 | amba_pm_runtime_resume, |
130 | NULL | 130 | NULL |
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 5fe59335e247..d9ca3e32d748 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -3051,7 +3051,7 @@ static int dma40_runtime_resume(struct device *dev) | |||
3051 | 3051 | ||
3052 | static const struct dev_pm_ops dma40_pm_ops = { | 3052 | static const struct dev_pm_ops dma40_pm_ops = { |
3053 | SET_LATE_SYSTEM_SLEEP_PM_OPS(dma40_suspend, dma40_resume) | 3053 | SET_LATE_SYSTEM_SLEEP_PM_OPS(dma40_suspend, dma40_resume) |
3054 | SET_PM_RUNTIME_PM_OPS(dma40_runtime_suspend, | 3054 | SET_RUNTIME_PM_OPS(dma40_runtime_suspend, |
3055 | dma40_runtime_resume, | 3055 | dma40_runtime_resume, |
3056 | NULL) | 3056 | NULL) |
3057 | }; | 3057 | }; |
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 74cd480bf8de..184c4b1b2558 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c | |||
@@ -578,7 +578,7 @@ static void zynq_gpio_free(struct gpio_chip *chip, unsigned offset) | |||
578 | 578 | ||
579 | static const struct dev_pm_ops zynq_gpio_dev_pm_ops = { | 579 | static const struct dev_pm_ops zynq_gpio_dev_pm_ops = { |
580 | SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume) | 580 | SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume) |
581 | SET_PM_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, | 581 | SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, |
582 | zynq_gpio_runtime_resume, NULL) | 582 | zynq_gpio_runtime_resume, NULL) |
583 | }; | 583 | }; |
584 | 584 | ||
diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c index 9490d0f4255c..8fe78d08e01c 100644 --- a/drivers/i2c/busses/i2c-hix5hd2.c +++ b/drivers/i2c/busses/i2c-hix5hd2.c | |||
@@ -528,7 +528,7 @@ static int hix5hd2_i2c_runtime_resume(struct device *dev) | |||
528 | #endif | 528 | #endif |
529 | 529 | ||
530 | static const struct dev_pm_ops hix5hd2_i2c_pm_ops = { | 530 | static const struct dev_pm_ops hix5hd2_i2c_pm_ops = { |
531 | SET_PM_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend, | 531 | SET_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend, |
532 | hix5hd2_i2c_runtime_resume, | 532 | hix5hd2_i2c_runtime_resume, |
533 | NULL) | 533 | NULL) |
534 | }; | 534 | }; |
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 9ad038d223c4..97998946c4f6 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c | |||
@@ -932,7 +932,7 @@ static int nmk_i2c_runtime_resume(struct device *dev) | |||
932 | 932 | ||
933 | static const struct dev_pm_ops nmk_i2c_pm = { | 933 | static const struct dev_pm_ops nmk_i2c_pm = { |
934 | SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early) | 934 | SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early) |
935 | SET_PM_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend, | 935 | SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend, |
936 | nmk_i2c_runtime_resume, | 936 | nmk_i2c_runtime_resume, |
937 | NULL) | 937 | NULL) |
938 | }; | 938 | }; |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 43af791e2e45..184ea59afa7e 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -1843,7 +1843,7 @@ static int mmci_runtime_resume(struct device *dev) | |||
1843 | static const struct dev_pm_ops mmci_dev_pm_ops = { | 1843 | static const struct dev_pm_ops mmci_dev_pm_ops = { |
1844 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, | 1844 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |
1845 | pm_runtime_force_resume) | 1845 | pm_runtime_force_resume) |
1846 | SET_PM_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL) | 1846 | SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL) |
1847 | }; | 1847 | }; |
1848 | 1848 | ||
1849 | static struct amba_id mmci_ids[] = { | 1849 | static struct amba_id mmci_ids[] = { |
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index a2e81a1ea6af..00c8ebdf8ec7 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c | |||
@@ -375,7 +375,7 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) | |||
375 | static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { | 375 | static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { |
376 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, | 376 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |
377 | pm_runtime_force_resume) | 377 | pm_runtime_force_resume) |
378 | SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, | 378 | SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, |
379 | tmio_mmc_host_runtime_resume, | 379 | tmio_mmc_host_runtime_resume, |
380 | NULL) | 380 | NULL) |
381 | }; | 381 | }; |
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 659028ddb8b1..2616fdfdbbeb 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -135,7 +135,7 @@ static int tmio_mmc_remove(struct platform_device *pdev) | |||
135 | 135 | ||
136 | static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { | 136 | static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { |
137 | SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume) | 137 | SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume) |
138 | SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, | 138 | SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, |
139 | tmio_mmc_host_runtime_resume, | 139 | tmio_mmc_host_runtime_resume, |
140 | NULL) | 140 | NULL) |
141 | }; | 141 | }; |
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index fc2dd8441608..89ca162801da 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c | |||
@@ -2377,7 +2377,7 @@ static int pl022_runtime_resume(struct device *dev) | |||
2377 | 2377 | ||
2378 | static const struct dev_pm_ops pl022_dev_pm_ops = { | 2378 | static const struct dev_pm_ops pl022_dev_pm_ops = { |
2379 | SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume) | 2379 | SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume) |
2380 | SET_PM_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL) | 2380 | SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL) |
2381 | }; | 2381 | }; |
2382 | 2382 | ||
2383 | static struct vendor_data vendor_arm = { | 2383 | static struct vendor_data vendor_arm = { |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 53b56cf5db3f..1dc338f6d4a9 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -342,7 +342,7 @@ struct dev_pm_ops { | |||
342 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | 342 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) |
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | #ifdef CONFIG_PM_RUNTIME | 345 | #ifdef CONFIG_PM |
346 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | 346 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ |
347 | .runtime_suspend = suspend_fn, \ | 347 | .runtime_suspend = suspend_fn, \ |
348 | .runtime_resume = resume_fn, \ | 348 | .runtime_resume = resume_fn, \ |
@@ -351,14 +351,7 @@ struct dev_pm_ops { | |||
351 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | 351 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) |
352 | #endif | 352 | #endif |
353 | 353 | ||
354 | #ifdef CONFIG_PM | 354 | #define SET_PM_RUNTIME_PM_OPS SET_RUNTIME_PM_OPS |
355 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | ||
356 | .runtime_suspend = suspend_fn, \ | ||
357 | .runtime_resume = resume_fn, \ | ||
358 | .runtime_idle = idle_fn, | ||
359 | #else | ||
360 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | ||
361 | #endif | ||
362 | 355 | ||
363 | /* | 356 | /* |
364 | * Use this if you want to use the same suspend and resume callbacks for suspend | 357 | * Use this if you want to use the same suspend and resume callbacks for suspend |