PM: Merge the SET*_RUNTIME_PM_OPS() macros
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 3 Dec 2014 23:34:11 +0000 (00:34 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 3 Dec 2014 23:51:30 +0000 (00:51 +0100)
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>
drivers/amba/bus.c
drivers/dma/ste_dma40.c
drivers/gpio/gpio-zynq.c
drivers/i2c/busses/i2c-hix5hd2.c
drivers/i2c/busses/i2c-nomadik.c
drivers/mmc/host/mmci.c
drivers/mmc/host/sh_mobile_sdhi.c
drivers/mmc/host/tmio_mmc.c
drivers/spi/spi-pl022.c
include/linux/pm.h

index 47bbdc1b5be327ddf913f920d8b78cfc4f253a0c..973a3332a85f91681ec62a4e77ad719fc3c1da0b 100644 (file)
@@ -124,7 +124,7 @@ static const struct dev_pm_ops amba_pm = {
        .thaw           = pm_generic_thaw,
        .poweroff       = pm_generic_poweroff,
        .restore        = pm_generic_restore,
-       SET_PM_RUNTIME_PM_OPS(
+       SET_RUNTIME_PM_OPS(
                amba_pm_runtime_suspend,
                amba_pm_runtime_resume,
                NULL
index 5fe59335e247ef81518a55fff496256009eafbcf..d9ca3e32d748e7853267053083be4b33a755d645 100644 (file)
@@ -3051,7 +3051,7 @@ static int dma40_runtime_resume(struct device *dev)
 
 static const struct dev_pm_ops dma40_pm_ops = {
        SET_LATE_SYSTEM_SLEEP_PM_OPS(dma40_suspend, dma40_resume)
-       SET_PM_RUNTIME_PM_OPS(dma40_runtime_suspend,
+       SET_RUNTIME_PM_OPS(dma40_runtime_suspend,
                                dma40_runtime_resume,
                                NULL)
 };
index 74cd480bf8de6975a8a3be485798255eca2cc431..184c4b1b255800dfb4a53914e3d803b51e70760f 100644 (file)
@@ -578,7 +578,7 @@ static void zynq_gpio_free(struct gpio_chip *chip, unsigned offset)
 
 static const struct dev_pm_ops zynq_gpio_dev_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume)
-       SET_PM_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
+       SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
                        zynq_gpio_runtime_resume, NULL)
 };
 
index 9490d0f4255c201e112a0c4bf5350fc8fa5dac30..8fe78d08e01cf1551ea0eaf53f50d2185dfff809 100644 (file)
@@ -528,7 +528,7 @@ static int hix5hd2_i2c_runtime_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops hix5hd2_i2c_pm_ops = {
-       SET_PM_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
+       SET_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend,
                              hix5hd2_i2c_runtime_resume,
                              NULL)
 };
index 9ad038d223c4b27de4c62e92816eafc048fed433..97998946c4f64b71d801539f2aa8b5583a9c7330 100644 (file)
@@ -932,7 +932,7 @@ static int nmk_i2c_runtime_resume(struct device *dev)
 
 static const struct dev_pm_ops nmk_i2c_pm = {
        SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
-       SET_PM_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
+       SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
                        nmk_i2c_runtime_resume,
                        NULL)
 };
index 43af791e2e45e1b29a94fc364978c99a315f2ffa..184ea59afa7e58fd82585be51de5aa3bc437bb94 100644 (file)
@@ -1843,7 +1843,7 @@ static int mmci_runtime_resume(struct device *dev)
 static const struct dev_pm_ops mmci_dev_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
                                pm_runtime_force_resume)
-       SET_PM_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
+       SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
 };
 
 static struct amba_id mmci_ids[] = {
index a2e81a1ea6af19ddae959327d9503189ff228659..00c8ebdf8ec78c8733483eafe80df417e07c7c9f 100644 (file)
@@ -375,7 +375,7 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
 static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
                        pm_runtime_force_resume)
-       SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
+       SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
                        tmio_mmc_host_runtime_resume,
                        NULL)
 };
index 659028ddb8b17e052721b0c8e9791ffbf598cd19..2616fdfdbbeb09a5d611e6f8bbc0c199b6871d86 100644 (file)
@@ -135,7 +135,7 @@ static int tmio_mmc_remove(struct platform_device *pdev)
 
 static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
-       SET_PM_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
+       SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
                        tmio_mmc_host_runtime_resume,
                        NULL)
 };
index fc2dd8441608fe31ad482800312fe26722c384e1..89ca162801da10b8ec7a9c4311a33344f6a438a7 100644 (file)
@@ -2377,7 +2377,7 @@ static int pl022_runtime_resume(struct device *dev)
 
 static const struct dev_pm_ops pl022_dev_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
-       SET_PM_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
+       SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
 };
 
 static struct vendor_data vendor_arm = {
index 53b56cf5db3f7166e4abe9aa106b98b48c09043f..1dc338f6d4a921750d396631fb1c20e370555447 100644 (file)
@@ -342,7 +342,7 @@ struct dev_pm_ops {
 #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
 #endif
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
        .runtime_suspend = suspend_fn, \
        .runtime_resume = resume_fn, \
@@ -351,14 +351,7 @@ struct dev_pm_ops {
 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
 #endif
 
-#ifdef CONFIG_PM
-#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
-       .runtime_suspend = suspend_fn, \
-       .runtime_resume = resume_fn, \
-       .runtime_idle = idle_fn,
-#else
-#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
-#endif
+#define SET_PM_RUNTIME_PM_OPS  SET_RUNTIME_PM_OPS
 
 /*
  * Use this if you want to use the same suspend and resume callbacks for suspend