All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops
@ 2016-07-27 11:31 Ulf Hansson
  2016-07-27 11:31 ` [PATCH 01/11] mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS Ulf Hansson
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:31 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

The code in various sdhci drivers can be cleaned up in regards how PM ops is
being defined and assigned. This series attempts to clean up this code.

In the end we want system PM sleep callbacks to be defined within #ifdef
CONFIG_PM_SLEEP and not as currently within CONFIG_PM.

Ulf Hansson (11):
  mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS
  mmc: sdhci-acpi: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS
  mmc: sdhci-of-esdhc: Simplify code by using SIMPLE_DEV_PM_OPS
  mmc: sdhci-pxav3: Remove non needed #ifdef CONFIG_PM for dev_pm_ops
  mmc: sdhci-s3c: Remove non needed #ifdef CONFIG_PM for dev_pm_ops
  mmc: sdhci-sirf: Remove non needed #ifdef CONFIG_PM* for dev_pm_ops
  mmc: sdhci-esdhc-imx: Assign system PM ops within #ifdef
    CONFIG_PM_SLEEP
  mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host()
  mmc: sdhci-pltfm: Make sdhci_pltfm_suspend|resume() static
  mmc: sdhci-pltfm: Convert to use the SET_SYSTEM_SLEEP_PM_OPS
  mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS

 drivers/mmc/host/sdhci-acpi.c      |  8 +-------
 drivers/mmc/host/sdhci-bcm-kona.c  |  2 +-
 drivers/mmc/host/sdhci-cns3xxx.c   |  2 +-
 drivers/mmc/host/sdhci-dove.c      |  2 +-
 drivers/mmc/host/sdhci-esdhc-imx.c | 10 +++++++---
 drivers/mmc/host/sdhci-iproc.c     |  2 +-
 drivers/mmc/host/sdhci-of-esdhc.c  | 16 ++++++----------
 drivers/mmc/host/sdhci-of-hlwd.c   |  2 +-
 drivers/mmc/host/sdhci-pci-core.c  | 16 +++++-----------
 drivers/mmc/host/sdhci-pltfm.c     | 13 +++++--------
 drivers/mmc/host/sdhci-pltfm.h     |  7 -------
 drivers/mmc/host/sdhci-pxav2.c     |  2 +-
 drivers/mmc/host/sdhci-pxav3.c     |  9 +--------
 drivers/mmc/host/sdhci-s3c.c       |  9 +--------
 drivers/mmc/host/sdhci-sirf.c      |  4 +---
 drivers/mmc/host/sdhci-tegra.c     |  2 +-
 drivers/mmc/host/sdhci_f_sdh30.c   |  2 +-
 17 files changed, 35 insertions(+), 73 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 01/11] mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
@ 2016-07-27 11:31 ` Ulf Hansson
  2016-07-27 11:31 ` [PATCH 02/11] mmc: sdhci-acpi: " Ulf Hansson
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:31 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

Convert to define the system PM callbacks to be build for CONFIG_PM_SLEEP
and use the SET_SYSTEM_SLEEP_PM_OPS. In this way the code becomes cleaner.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-pci-core.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index bdda3d0..897cfd2 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -1413,8 +1413,7 @@ static const struct sdhci_ops sdhci_pci_ops = {
  *                                                                           *
 \*****************************************************************************/
 
-#ifdef CONFIG_PM
-
+#ifdef CONFIG_PM_SLEEP
 static int sdhci_pci_suspend(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
@@ -1496,7 +1495,9 @@ static int sdhci_pci_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
+#ifdef CONFIG_PM
 static int sdhci_pci_runtime_suspend(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
@@ -1562,17 +1563,10 @@ static int sdhci_pci_runtime_resume(struct device *dev)
 
 	return 0;
 }
-
-#else /* CONFIG_PM */
-
-#define sdhci_pci_suspend NULL
-#define sdhci_pci_resume NULL
-
-#endif /* CONFIG_PM */
+#endif
 
 static const struct dev_pm_ops sdhci_pci_pm_ops = {
-	.suspend = sdhci_pci_suspend,
-	.resume = sdhci_pci_resume,
+	SET_SYSTEM_SLEEP_PM_OPS(sdhci_pci_suspend, sdhci_pci_resume)
 	SET_RUNTIME_PM_OPS(sdhci_pci_runtime_suspend,
 			sdhci_pci_runtime_resume, NULL)
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 02/11] mmc: sdhci-acpi: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
  2016-07-27 11:31 ` [PATCH 01/11] mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS Ulf Hansson
@ 2016-07-27 11:31 ` Ulf Hansson
  2016-07-27 11:31 ` [PATCH 03/11] mmc: sdhci-of-esdhc: Simplify code by using SIMPLE_DEV_PM_OPS Ulf Hansson
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:31 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

By using the SET_SYSTEM_SLEEP_PM_OPS when assigning the system PM
callbacks, we can remove some #ifdefs so code becomes a bit cleaner.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-acpi.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 458ffb7..5bf4bcf 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -531,11 +531,6 @@ static int sdhci_acpi_resume(struct device *dev)
 	return sdhci_resume_host(c->host);
 }
 
-#else
-
-#define sdhci_acpi_suspend	NULL
-#define sdhci_acpi_resume	NULL
-
 #endif
 
 #ifdef CONFIG_PM
@@ -559,8 +554,7 @@ static int sdhci_acpi_runtime_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops sdhci_acpi_pm_ops = {
-	.suspend		= sdhci_acpi_suspend,
-	.resume			= sdhci_acpi_resume,
+	SET_SYSTEM_SLEEP_PM_OPS(sdhci_acpi_suspend, sdhci_acpi_resume)
 	SET_RUNTIME_PM_OPS(sdhci_acpi_runtime_suspend,
 			sdhci_acpi_runtime_resume, NULL)
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 03/11] mmc: sdhci-of-esdhc: Simplify code by using SIMPLE_DEV_PM_OPS
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
  2016-07-27 11:31 ` [PATCH 01/11] mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS Ulf Hansson
  2016-07-27 11:31 ` [PATCH 02/11] mmc: sdhci-acpi: " Ulf Hansson
@ 2016-07-27 11:31 ` Ulf Hansson
  2016-07-27 11:32 ` [PATCH 04/11] mmc: sdhci-pxav3: Remove non needed #ifdef CONFIG_PM for dev_pm_ops Ulf Hansson
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:31 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

Let's use the SIMPLE_DEV_PM_OPS macro when declaring/assigning the system
PM callbacks, as the code gets simplified.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-of-esdhc.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index 3f34d35..239be2f 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -481,7 +481,7 @@ static void esdhc_reset(struct sdhci_host *host, u8 mask)
 	sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static u32 esdhc_proctl;
 static int esdhc_of_suspend(struct device *dev)
 {
@@ -504,16 +504,12 @@ static int esdhc_of_resume(struct device *dev)
 	}
 	return ret;
 }
-
-static const struct dev_pm_ops esdhc_pmops = {
-	.suspend	= esdhc_of_suspend,
-	.resume		= esdhc_of_resume,
-};
-#define ESDHC_PMOPS (&esdhc_pmops)
-#else
-#define ESDHC_PMOPS NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(esdhc_of_dev_pm_ops,
+			esdhc_of_suspend,
+			esdhc_of_resume);
+
 static const struct sdhci_ops sdhci_esdhc_be_ops = {
 	.read_l = esdhc_be_readl,
 	.read_w = esdhc_be_readw,
@@ -657,7 +653,7 @@ static struct platform_driver sdhci_esdhc_driver = {
 	.driver = {
 		.name = "sdhci-esdhc",
 		.of_match_table = sdhci_esdhc_of_match,
-		.pm = ESDHC_PMOPS,
+		.pm = &esdhc_of_dev_pm_ops,
 	},
 	.probe = sdhci_esdhc_probe,
 	.remove = sdhci_pltfm_unregister,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 04/11] mmc: sdhci-pxav3: Remove non needed #ifdef CONFIG_PM for dev_pm_ops
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
                   ` (2 preceding siblings ...)
  2016-07-27 11:31 ` [PATCH 03/11] mmc: sdhci-of-esdhc: Simplify code by using SIMPLE_DEV_PM_OPS Ulf Hansson
@ 2016-07-27 11:32 ` Ulf Hansson
  2016-07-27 11:32 ` [PATCH 05/11] mmc: sdhci-s3c: " Ulf Hansson
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:32 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

As the SET_SYSTEM_SLEEP_PM_OPS and the SET_RUNTIME_PM_OPS macro deals with
the CONFIG_PM options when assigning the callbacks, it becomes redundant
to control this when declaring the struct dev_pm_ops. Instead let's always
declare it as it simplifies the code.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-pxav3.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 3013250..dd1938d 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -583,24 +583,17 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
 }
 #endif
 
-#ifdef CONFIG_PM
 static const struct dev_pm_ops sdhci_pxav3_pmops = {
 	SET_SYSTEM_SLEEP_PM_OPS(sdhci_pxav3_suspend, sdhci_pxav3_resume)
 	SET_RUNTIME_PM_OPS(sdhci_pxav3_runtime_suspend,
 		sdhci_pxav3_runtime_resume, NULL)
 };
 
-#define SDHCI_PXAV3_PMOPS (&sdhci_pxav3_pmops)
-
-#else
-#define SDHCI_PXAV3_PMOPS NULL
-#endif
-
 static struct platform_driver sdhci_pxav3_driver = {
 	.driver		= {
 		.name	= "sdhci-pxav3",
 		.of_match_table = of_match_ptr(sdhci_pxav3_of_match),
-		.pm	= SDHCI_PXAV3_PMOPS,
+		.pm	= &sdhci_pxav3_pmops,
 	},
 	.probe		= sdhci_pxav3_probe,
 	.remove		= sdhci_pxav3_remove,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 05/11] mmc: sdhci-s3c: Remove non needed #ifdef CONFIG_PM for dev_pm_ops
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
                   ` (3 preceding siblings ...)
  2016-07-27 11:32 ` [PATCH 04/11] mmc: sdhci-pxav3: Remove non needed #ifdef CONFIG_PM for dev_pm_ops Ulf Hansson
@ 2016-07-27 11:32 ` Ulf Hansson
  2016-07-27 11:32 ` [PATCH 06/11] mmc: sdhci-sirf: Remove non needed #ifdef CONFIG_PM* " Ulf Hansson
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:32 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

As the SET_SYSTEM_SLEEP_PM_OPS and the SET_RUNTIME_PM_OPS macro deals with
the CONFIG_PM options when assigning the callbacks, it becomes redundant
to control this when declaring the struct dev_pm_ops. Instead let's always
declare it as it simplifies the code.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-s3c.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 70c724b..784c5a8 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -714,19 +714,12 @@ static int sdhci_s3c_runtime_resume(struct device *dev)
 }
 #endif
 
-#ifdef CONFIG_PM
 static const struct dev_pm_ops sdhci_s3c_pmops = {
 	SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume)
 	SET_RUNTIME_PM_OPS(sdhci_s3c_runtime_suspend, sdhci_s3c_runtime_resume,
 			   NULL)
 };
 
-#define SDHCI_S3C_PMOPS (&sdhci_s3c_pmops)
-
-#else
-#define SDHCI_S3C_PMOPS NULL
-#endif
-
 #if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS4212)
 static struct sdhci_s3c_drv_data exynos4_sdhci_drv_data = {
 	.no_divider = true,
@@ -765,7 +758,7 @@ static struct platform_driver sdhci_s3c_driver = {
 	.driver		= {
 		.name	= "s3c-sdhci",
 		.of_match_table = of_match_ptr(sdhci_s3c_dt_match),
-		.pm	= SDHCI_S3C_PMOPS,
+		.pm	= &sdhci_s3c_pmops,
 	},
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 06/11] mmc: sdhci-sirf: Remove non needed #ifdef CONFIG_PM* for dev_pm_ops
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
                   ` (4 preceding siblings ...)
  2016-07-27 11:32 ` [PATCH 05/11] mmc: sdhci-s3c: " Ulf Hansson
@ 2016-07-27 11:32 ` Ulf Hansson
  2016-07-27 11:32 ` [PATCH 07/11] mmc: sdhci-esdhc-imx: Assign system PM ops within #ifdef CONFIG_PM_SLEEP Ulf Hansson
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:32 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

The SIMPLE_DEV_PM_OPS macro deals with the CONFIG_PM options when
assigning the PM callbacks, thus it's not needed to control this when
using the macro. By removing the non needed #ifdef, the code becomes a
bit cleaner.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-sirf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c
index 34866f6..5d06863 100644
--- a/drivers/mmc/host/sdhci-sirf.c
+++ b/drivers/mmc/host/sdhci-sirf.c
@@ -260,9 +260,9 @@ static int sdhci_sirf_resume(struct device *dev)
 
 	return sdhci_resume_host(host);
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(sdhci_sirf_pm_ops, sdhci_sirf_suspend, sdhci_sirf_resume);
-#endif
 
 static const struct of_device_id sdhci_sirf_of_match[] = {
 	{ .compatible = "sirf,prima2-sdhc" },
@@ -274,9 +274,7 @@ static struct platform_driver sdhci_sirf_driver = {
 	.driver		= {
 		.name	= "sdhci-sirf",
 		.of_match_table = sdhci_sirf_of_match,
-#ifdef CONFIG_PM_SLEEP
 		.pm	= &sdhci_sirf_pm_ops,
-#endif
 	},
 	.probe		= sdhci_sirf_probe,
 	.remove		= sdhci_pltfm_unregister,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 07/11] mmc: sdhci-esdhc-imx: Assign system PM ops within #ifdef CONFIG_PM_SLEEP
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
                   ` (5 preceding siblings ...)
  2016-07-27 11:32 ` [PATCH 06/11] mmc: sdhci-sirf: Remove non needed #ifdef CONFIG_PM* " Ulf Hansson
@ 2016-07-27 11:32 ` Ulf Hansson
  2016-07-29  8:38   ` Dong Aisheng
  2016-07-27 11:32 ` [PATCH 08/11] mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host() Ulf Hansson
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:32 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann, Dong Aisheng

The system PM callbacks isn't used unless CONFIG_PM_SLEEP is set, thus it
triggers a compiler warning about unused functions. Avoid this by changing
from CONFIG_PM to CONFIG_PM_SLEEP.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b70d0b3b5b29 ("mmc: sdhci-esdhc-imx: add esdhc specific suspend resume callback")
Cc: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 2bb326b..f5768a6 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1293,7 +1293,7 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int sdhci_esdhc_suspend(struct device *dev)
 {
 	return sdhci_pltfm_suspend(dev);
@@ -1308,7 +1308,9 @@ static int sdhci_esdhc_resume(struct device *dev)
 
 	return sdhci_pltfm_resume(dev);
 }
+#endif
 
+#ifdef CONFIG_PM
 static int sdhci_esdhc_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 08/11] mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host()
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
                   ` (6 preceding siblings ...)
  2016-07-27 11:32 ` [PATCH 07/11] mmc: sdhci-esdhc-imx: Assign system PM ops within #ifdef CONFIG_PM_SLEEP Ulf Hansson
@ 2016-07-27 11:32 ` Ulf Hansson
  2016-07-29  8:39   ` Dong Aisheng
  2016-07-27 11:32 ` [PATCH 09/11] mmc: sdhci-pltfm: Make sdhci_pltfm_suspend|resume() static Ulf Hansson
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:32 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

To prepare to make the sdhci_pltfm_suspend|resume() static functions, move
sdhci-esdhc-imx over to use the sdhci_suspend|resume_host().

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index f5768a6..99e0b33 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1296,7 +1296,9 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int sdhci_esdhc_suspend(struct device *dev)
 {
-	return sdhci_pltfm_suspend(dev);
+	struct sdhci_host *host = dev_get_drvdata(dev);
+
+	return sdhci_suspend_host(host);
 }
 
 static int sdhci_esdhc_resume(struct device *dev)
@@ -1306,7 +1308,7 @@ static int sdhci_esdhc_resume(struct device *dev)
 	/* re-initialize hw state in case it's lost in low power mode */
 	sdhci_esdhc_imx_hwinit(host);
 
-	return sdhci_pltfm_resume(dev);
+	return sdhci_resume_host(host);
 }
 #endif
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 09/11] mmc: sdhci-pltfm: Make sdhci_pltfm_suspend|resume() static
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
                   ` (7 preceding siblings ...)
  2016-07-27 11:32 ` [PATCH 08/11] mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host() Ulf Hansson
@ 2016-07-27 11:32 ` Ulf Hansson
  2016-07-27 11:32 ` [PATCH 10/11] mmc: sdhci-pltfm: Convert to use the SET_SYSTEM_SLEEP_PM_OPS Ulf Hansson
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:32 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

There are no users left of these exported APIs, so let's make them static.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-pltfm.c | 6 ++----
 drivers/mmc/host/sdhci-pltfm.h | 2 --
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 64f287a..7b1aacc 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -216,21 +216,19 @@ int sdhci_pltfm_unregister(struct platform_device *pdev)
 EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
 
 #ifdef CONFIG_PM
-int sdhci_pltfm_suspend(struct device *dev)
+static int sdhci_pltfm_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 
 	return sdhci_suspend_host(host);
 }
-EXPORT_SYMBOL_GPL(sdhci_pltfm_suspend);
 
-int sdhci_pltfm_resume(struct device *dev)
+static int sdhci_pltfm_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 
 	return sdhci_resume_host(host);
 }
-EXPORT_SYMBOL_GPL(sdhci_pltfm_resume);
 
 const struct dev_pm_ops sdhci_pltfm_pmops = {
 	.suspend	= sdhci_pltfm_suspend,
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
index d38053b..6c99210 100644
--- a/drivers/mmc/host/sdhci-pltfm.h
+++ b/drivers/mmc/host/sdhci-pltfm.h
@@ -110,8 +110,6 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host)
 }
 
 #ifdef CONFIG_PM
-extern int sdhci_pltfm_suspend(struct device *dev);
-extern int sdhci_pltfm_resume(struct device *dev);
 extern const struct dev_pm_ops sdhci_pltfm_pmops;
 #define SDHCI_PLTFM_PMOPS (&sdhci_pltfm_pmops)
 #else
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 10/11] mmc: sdhci-pltfm: Convert to use the SET_SYSTEM_SLEEP_PM_OPS
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
                   ` (8 preceding siblings ...)
  2016-07-27 11:32 ` [PATCH 09/11] mmc: sdhci-pltfm: Make sdhci_pltfm_suspend|resume() static Ulf Hansson
@ 2016-07-27 11:32 ` Ulf Hansson
  2016-07-27 11:32 ` [PATCH 11/11] mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS Ulf Hansson
  2016-07-27 12:50 ` [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
  11 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:32 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

Move the system PM callbacks within #ifdef CONFIG_PM_SLEEP as to avoid
them being build when not used. This also allows us to use the
SET_SYSTEM_SLEEP_PM_OPS macro which simplifies the code.

Within this context it also makes sense to move the declaration of the
struct sdhci_pltfm_pmops, outside the #ifdef CONFIG_PM as the
SET_SYSTEM_SLEEP_PM_OPS deals with this. This further simplifies the code.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-pltfm.c | 7 +++----
 drivers/mmc/host/sdhci-pltfm.h | 4 ----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 7b1aacc..1d17dcf 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -215,7 +215,7 @@ int sdhci_pltfm_unregister(struct platform_device *pdev)
 }
 EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int sdhci_pltfm_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -229,13 +229,12 @@ static int sdhci_pltfm_resume(struct device *dev)
 
 	return sdhci_resume_host(host);
 }
+#endif
 
 const struct dev_pm_ops sdhci_pltfm_pmops = {
-	.suspend	= sdhci_pltfm_suspend,
-	.resume		= sdhci_pltfm_resume,
+	SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_pltfm_resume)
 };
 EXPORT_SYMBOL_GPL(sdhci_pltfm_pmops);
-#endif	/* CONFIG_PM */
 
 static int __init sdhci_pltfm_drv_init(void)
 {
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
index 6c99210..0883a2a 100644
--- a/drivers/mmc/host/sdhci-pltfm.h
+++ b/drivers/mmc/host/sdhci-pltfm.h
@@ -109,11 +109,7 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host)
 	return (void *)host->private;
 }
 
-#ifdef CONFIG_PM
 extern const struct dev_pm_ops sdhci_pltfm_pmops;
 #define SDHCI_PLTFM_PMOPS (&sdhci_pltfm_pmops)
-#else
-#define SDHCI_PLTFM_PMOPS NULL
-#endif
 
 #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 11/11] mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
                   ` (9 preceding siblings ...)
  2016-07-27 11:32 ` [PATCH 10/11] mmc: sdhci-pltfm: Convert to use the SET_SYSTEM_SLEEP_PM_OPS Ulf Hansson
@ 2016-07-27 11:32 ` Ulf Hansson
  2016-07-27 12:50 ` [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
  11 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 11:32 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

Due to previous changes this define has no longer a purpose. Instead move
the sdhci-pltfm drivers over to use the exported struct sdhci_pltfm_pmops.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sdhci-bcm-kona.c | 2 +-
 drivers/mmc/host/sdhci-cns3xxx.c  | 2 +-
 drivers/mmc/host/sdhci-dove.c     | 2 +-
 drivers/mmc/host/sdhci-iproc.c    | 2 +-
 drivers/mmc/host/sdhci-of-hlwd.c  | 2 +-
 drivers/mmc/host/sdhci-pltfm.h    | 1 -
 drivers/mmc/host/sdhci-pxav2.c    | 2 +-
 drivers/mmc/host/sdhci-tegra.c    | 2 +-
 drivers/mmc/host/sdhci_f_sdh30.c  | 2 +-
 9 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
index 1d64712..e5c634b 100644
--- a/drivers/mmc/host/sdhci-bcm-kona.c
+++ b/drivers/mmc/host/sdhci-bcm-kona.c
@@ -326,7 +326,7 @@ err_pltfm_free:
 static struct platform_driver sdhci_bcm_kona_driver = {
 	.driver		= {
 		.name	= "sdhci-kona",
-		.pm	= SDHCI_PLTFM_PMOPS,
+		.pm	= &sdhci_pltfm_pmops,
 		.of_match_table = sdhci_bcm_kona_of_match,
 	},
 	.probe		= sdhci_bcm_kona_probe,
diff --git a/drivers/mmc/host/sdhci-cns3xxx.c b/drivers/mmc/host/sdhci-cns3xxx.c
index 59f2923..bd286db 100644
--- a/drivers/mmc/host/sdhci-cns3xxx.c
+++ b/drivers/mmc/host/sdhci-cns3xxx.c
@@ -101,7 +101,7 @@ static int sdhci_cns3xxx_probe(struct platform_device *pdev)
 static struct platform_driver sdhci_cns3xxx_driver = {
 	.driver		= {
 		.name	= "sdhci-cns3xxx",
-		.pm	= SDHCI_PLTFM_PMOPS,
+		.pm	= &sdhci_pltfm_pmops,
 	},
 	.probe		= sdhci_cns3xxx_probe,
 	.remove		= sdhci_pltfm_unregister,
diff --git a/drivers/mmc/host/sdhci-dove.c b/drivers/mmc/host/sdhci-dove.c
index 407c21f..de9f960 100644
--- a/drivers/mmc/host/sdhci-dove.c
+++ b/drivers/mmc/host/sdhci-dove.c
@@ -117,7 +117,7 @@ MODULE_DEVICE_TABLE(of, sdhci_dove_of_match_table);
 static struct platform_driver sdhci_dove_driver = {
 	.driver		= {
 		.name	= "sdhci-dove",
-		.pm	= SDHCI_PLTFM_PMOPS,
+		.pm	= &sdhci_pltfm_pmops,
 		.of_match_table = sdhci_dove_of_match_table,
 	},
 	.probe		= sdhci_dove_probe,
diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
index 53abecc..7262466 100644
--- a/drivers/mmc/host/sdhci-iproc.c
+++ b/drivers/mmc/host/sdhci-iproc.c
@@ -260,7 +260,7 @@ static struct platform_driver sdhci_iproc_driver = {
 	.driver = {
 		.name = "sdhci-iproc",
 		.of_match_table = sdhci_iproc_of_match,
-		.pm = SDHCI_PLTFM_PMOPS,
+		.pm = &sdhci_pltfm_pmops,
 	},
 	.probe = sdhci_iproc_probe,
 	.remove = sdhci_pltfm_unregister,
diff --git a/drivers/mmc/host/sdhci-of-hlwd.c b/drivers/mmc/host/sdhci-of-hlwd.c
index 4079a96..ac00c5e 100644
--- a/drivers/mmc/host/sdhci-of-hlwd.c
+++ b/drivers/mmc/host/sdhci-of-hlwd.c
@@ -85,7 +85,7 @@ static struct platform_driver sdhci_hlwd_driver = {
 	.driver = {
 		.name = "sdhci-hlwd",
 		.of_match_table = sdhci_hlwd_of_match,
-		.pm = SDHCI_PLTFM_PMOPS,
+		.pm = &sdhci_pltfm_pmops,
 	},
 	.probe = sdhci_hlwd_probe,
 	.remove = sdhci_pltfm_unregister,
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
index 0883a2a..3280f20 100644
--- a/drivers/mmc/host/sdhci-pltfm.h
+++ b/drivers/mmc/host/sdhci-pltfm.h
@@ -110,6 +110,5 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host)
 }
 
 extern const struct dev_pm_ops sdhci_pltfm_pmops;
-#define SDHCI_PLTFM_PMOPS (&sdhci_pltfm_pmops)
 
 #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */
diff --git a/drivers/mmc/host/sdhci-pxav2.c b/drivers/mmc/host/sdhci-pxav2.c
index 1d8dd35..347eae2 100644
--- a/drivers/mmc/host/sdhci-pxav2.c
+++ b/drivers/mmc/host/sdhci-pxav2.c
@@ -252,7 +252,7 @@ static struct platform_driver sdhci_pxav2_driver = {
 	.driver		= {
 		.name	= "sdhci-pxav2",
 		.of_match_table = of_match_ptr(sdhci_pxav2_of_match),
-		.pm	= SDHCI_PLTFM_PMOPS,
+		.pm	= &sdhci_pltfm_pmops,
 	},
 	.probe		= sdhci_pxav2_probe,
 	.remove		= sdhci_pxav2_remove,
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index bd11998..1e93dc4 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -483,7 +483,7 @@ static struct platform_driver sdhci_tegra_driver = {
 	.driver		= {
 		.name	= "sdhci-tegra",
 		.of_match_table = sdhci_tegra_dt_match,
-		.pm	= SDHCI_PLTFM_PMOPS,
+		.pm	= &sdhci_pltfm_pmops,
 	},
 	.probe		= sdhci_tegra_probe,
 	.remove		= sdhci_pltfm_unregister,
diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
index 983b8b3..111b66f 100644
--- a/drivers/mmc/host/sdhci_f_sdh30.c
+++ b/drivers/mmc/host/sdhci_f_sdh30.c
@@ -222,7 +222,7 @@ static struct platform_driver sdhci_f_sdh30_driver = {
 	.driver = {
 		.name = "f_sdh30",
 		.of_match_table = f_sdh30_dt_ids,
-		.pm	= SDHCI_PLTFM_PMOPS,
+		.pm	= &sdhci_pltfm_pmops,
 	},
 	.probe	= sdhci_f_sdh30_probe,
 	.remove	= sdhci_f_sdh30_remove,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops
  2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
                   ` (10 preceding siblings ...)
  2016-07-27 11:32 ` [PATCH 11/11] mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS Ulf Hansson
@ 2016-07-27 12:50 ` Ulf Hansson
  2016-07-28 10:27   ` Jaehoon Chung
  11 siblings, 1 reply; 16+ messages in thread
From: Ulf Hansson @ 2016-07-27 12:50 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Adrian Hunter; +Cc: Arnd Bergmann

On 27 July 2016 at 13:31, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> The code in various sdhci drivers can be cleaned up in regards how PM ops is
> being defined and assigned. This series attempts to clean up this code.
>
> In the end we want system PM sleep callbacks to be defined within #ifdef
> CONFIG_PM_SLEEP and not as currently within CONFIG_PM.
>
> Ulf Hansson (11):
>   mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS
>   mmc: sdhci-acpi: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS
>   mmc: sdhci-of-esdhc: Simplify code by using SIMPLE_DEV_PM_OPS
>   mmc: sdhci-pxav3: Remove non needed #ifdef CONFIG_PM for dev_pm_ops
>   mmc: sdhci-s3c: Remove non needed #ifdef CONFIG_PM for dev_pm_ops
>   mmc: sdhci-sirf: Remove non needed #ifdef CONFIG_PM* for dev_pm_ops
>   mmc: sdhci-esdhc-imx: Assign system PM ops within #ifdef
>     CONFIG_PM_SLEEP
>   mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host()
>   mmc: sdhci-pltfm: Make sdhci_pltfm_suspend|resume() static
>   mmc: sdhci-pltfm: Convert to use the SET_SYSTEM_SLEEP_PM_OPS
>   mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS
>
>  drivers/mmc/host/sdhci-acpi.c      |  8 +-------
>  drivers/mmc/host/sdhci-bcm-kona.c  |  2 +-
>  drivers/mmc/host/sdhci-cns3xxx.c   |  2 +-
>  drivers/mmc/host/sdhci-dove.c      |  2 +-
>  drivers/mmc/host/sdhci-esdhc-imx.c | 10 +++++++---
>  drivers/mmc/host/sdhci-iproc.c     |  2 +-
>  drivers/mmc/host/sdhci-of-esdhc.c  | 16 ++++++----------
>  drivers/mmc/host/sdhci-of-hlwd.c   |  2 +-
>  drivers/mmc/host/sdhci-pci-core.c  | 16 +++++-----------
>  drivers/mmc/host/sdhci-pltfm.c     | 13 +++++--------
>  drivers/mmc/host/sdhci-pltfm.h     |  7 -------
>  drivers/mmc/host/sdhci-pxav2.c     |  2 +-
>  drivers/mmc/host/sdhci-pxav3.c     |  9 +--------
>  drivers/mmc/host/sdhci-s3c.c       |  9 +--------
>  drivers/mmc/host/sdhci-sirf.c      |  4 +---
>  drivers/mmc/host/sdhci-tegra.c     |  2 +-
>  drivers/mmc/host/sdhci_f_sdh30.c   |  2 +-
>  17 files changed, 35 insertions(+), 73 deletions(-)
>
> --
> 1.9.1
>

I decided to queue up this for next, as most of these are rather
trivial changes and to get it tested in next.

Feel free to add acks/reviewed-by, or tell me to drop these changes!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops
  2016-07-27 12:50 ` [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
@ 2016-07-28 10:27   ` Jaehoon Chung
  0 siblings, 0 replies; 16+ messages in thread
From: Jaehoon Chung @ 2016-07-28 10:27 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc, Adrian Hunter; +Cc: Arnd Bergmann

Hi Ulf,

On 07/27/2016 09:50 PM, Ulf Hansson wrote:
> On 27 July 2016 at 13:31, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> The code in various sdhci drivers can be cleaned up in regards how PM ops is
>> being defined and assigned. This series attempts to clean up this code.
>>
>> In the end we want system PM sleep callbacks to be defined within #ifdef
>> CONFIG_PM_SLEEP and not as currently within CONFIG_PM.

It seems that dwmmc controller can also apply the similar cleanup patches.
After checking, i will send the patches..

Best Regards,
Jaehoon Chung

>>
>> Ulf Hansson (11):
>>   mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS
>>   mmc: sdhci-acpi: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS
>>   mmc: sdhci-of-esdhc: Simplify code by using SIMPLE_DEV_PM_OPS
>>   mmc: sdhci-pxav3: Remove non needed #ifdef CONFIG_PM for dev_pm_ops
>>   mmc: sdhci-s3c: Remove non needed #ifdef CONFIG_PM for dev_pm_ops
>>   mmc: sdhci-sirf: Remove non needed #ifdef CONFIG_PM* for dev_pm_ops
>>   mmc: sdhci-esdhc-imx: Assign system PM ops within #ifdef
>>     CONFIG_PM_SLEEP
>>   mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host()
>>   mmc: sdhci-pltfm: Make sdhci_pltfm_suspend|resume() static
>>   mmc: sdhci-pltfm: Convert to use the SET_SYSTEM_SLEEP_PM_OPS
>>   mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS
>>
>>  drivers/mmc/host/sdhci-acpi.c      |  8 +-------
>>  drivers/mmc/host/sdhci-bcm-kona.c  |  2 +-
>>  drivers/mmc/host/sdhci-cns3xxx.c   |  2 +-
>>  drivers/mmc/host/sdhci-dove.c      |  2 +-
>>  drivers/mmc/host/sdhci-esdhc-imx.c | 10 +++++++---
>>  drivers/mmc/host/sdhci-iproc.c     |  2 +-
>>  drivers/mmc/host/sdhci-of-esdhc.c  | 16 ++++++----------
>>  drivers/mmc/host/sdhci-of-hlwd.c   |  2 +-
>>  drivers/mmc/host/sdhci-pci-core.c  | 16 +++++-----------
>>  drivers/mmc/host/sdhci-pltfm.c     | 13 +++++--------
>>  drivers/mmc/host/sdhci-pltfm.h     |  7 -------
>>  drivers/mmc/host/sdhci-pxav2.c     |  2 +-
>>  drivers/mmc/host/sdhci-pxav3.c     |  9 +--------
>>  drivers/mmc/host/sdhci-s3c.c       |  9 +--------
>>  drivers/mmc/host/sdhci-sirf.c      |  4 +---
>>  drivers/mmc/host/sdhci-tegra.c     |  2 +-
>>  drivers/mmc/host/sdhci_f_sdh30.c   |  2 +-
>>  17 files changed, 35 insertions(+), 73 deletions(-)
>>
>> --
>> 1.9.1
>>
> 
> I decided to queue up this for next, as most of these are rather
> trivial changes and to get it tested in next.
> 
> Feel free to add acks/reviewed-by, or tell me to drop these changes!
> 
> Kind regards
> Uffe
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 07/11] mmc: sdhci-esdhc-imx: Assign system PM ops within #ifdef CONFIG_PM_SLEEP
  2016-07-27 11:32 ` [PATCH 07/11] mmc: sdhci-esdhc-imx: Assign system PM ops within #ifdef CONFIG_PM_SLEEP Ulf Hansson
@ 2016-07-29  8:38   ` Dong Aisheng
  0 siblings, 0 replies; 16+ messages in thread
From: Dong Aisheng @ 2016-07-29  8:38 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Adrian Hunter, Arnd Bergmann, Dong Aisheng

On Wed, Jul 27, 2016 at 01:32:03PM +0200, Ulf Hansson wrote:
> The system PM callbacks isn't used unless CONFIG_PM_SLEEP is set, thus it
> triggers a compiler warning about unused functions. Avoid this by changing
> from CONFIG_PM to CONFIG_PM_SLEEP.
> 
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: b70d0b3b5b29 ("mmc: sdhci-esdhc-imx: add esdhc specific suspend resume callback")
> Cc: Dong Aisheng <aisheng.dong@nxp.com>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>


Thanks for the clean up.
I'm okay with the either way as you discussed with Arnd.

So
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Dong Aisheng

> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 2bb326b..f5768a6 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1293,7 +1293,7 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
>  static int sdhci_esdhc_suspend(struct device *dev)
>  {
>  	return sdhci_pltfm_suspend(dev);
> @@ -1308,7 +1308,9 @@ static int sdhci_esdhc_resume(struct device *dev)
>  
>  	return sdhci_pltfm_resume(dev);
>  }
> +#endif
>  
> +#ifdef CONFIG_PM
>  static int sdhci_esdhc_runtime_suspend(struct device *dev)
>  {
>  	struct sdhci_host *host = dev_get_drvdata(dev);
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 08/11] mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host()
  2016-07-27 11:32 ` [PATCH 08/11] mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host() Ulf Hansson
@ 2016-07-29  8:39   ` Dong Aisheng
  0 siblings, 0 replies; 16+ messages in thread
From: Dong Aisheng @ 2016-07-29  8:39 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Adrian Hunter, Arnd Bergmann

On Wed, Jul 27, 2016 at 01:32:04PM +0200, Ulf Hansson wrote:
> To prepare to make the sdhci_pltfm_suspend|resume() static functions, move
> sdhci-esdhc-imx over to use the sdhci_suspend|resume_host().
> 

Acked-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Dong Aisheng

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index f5768a6..99e0b33 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1296,7 +1296,9 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
>  #ifdef CONFIG_PM_SLEEP
>  static int sdhci_esdhc_suspend(struct device *dev)
>  {
> -	return sdhci_pltfm_suspend(dev);
> +	struct sdhci_host *host = dev_get_drvdata(dev);
> +
> +	return sdhci_suspend_host(host);
>  }
>  
>  static int sdhci_esdhc_resume(struct device *dev)
> @@ -1306,7 +1308,7 @@ static int sdhci_esdhc_resume(struct device *dev)
>  	/* re-initialize hw state in case it's lost in low power mode */
>  	sdhci_esdhc_imx_hwinit(host);
>  
> -	return sdhci_pltfm_resume(dev);
> +	return sdhci_resume_host(host);
>  }
>  #endif
>  
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-07-29  8:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-27 11:31 [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
2016-07-27 11:31 ` [PATCH 01/11] mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS Ulf Hansson
2016-07-27 11:31 ` [PATCH 02/11] mmc: sdhci-acpi: " Ulf Hansson
2016-07-27 11:31 ` [PATCH 03/11] mmc: sdhci-of-esdhc: Simplify code by using SIMPLE_DEV_PM_OPS Ulf Hansson
2016-07-27 11:32 ` [PATCH 04/11] mmc: sdhci-pxav3: Remove non needed #ifdef CONFIG_PM for dev_pm_ops Ulf Hansson
2016-07-27 11:32 ` [PATCH 05/11] mmc: sdhci-s3c: " Ulf Hansson
2016-07-27 11:32 ` [PATCH 06/11] mmc: sdhci-sirf: Remove non needed #ifdef CONFIG_PM* " Ulf Hansson
2016-07-27 11:32 ` [PATCH 07/11] mmc: sdhci-esdhc-imx: Assign system PM ops within #ifdef CONFIG_PM_SLEEP Ulf Hansson
2016-07-29  8:38   ` Dong Aisheng
2016-07-27 11:32 ` [PATCH 08/11] mmc: sdhci-esdhc-imx: Use common sdhci_suspend|resume_host() Ulf Hansson
2016-07-29  8:39   ` Dong Aisheng
2016-07-27 11:32 ` [PATCH 09/11] mmc: sdhci-pltfm: Make sdhci_pltfm_suspend|resume() static Ulf Hansson
2016-07-27 11:32 ` [PATCH 10/11] mmc: sdhci-pltfm: Convert to use the SET_SYSTEM_SLEEP_PM_OPS Ulf Hansson
2016-07-27 11:32 ` [PATCH 11/11] mmc: sdhci-pltfm: Drop define for SDHCI_PLTFM_PMOPS Ulf Hansson
2016-07-27 12:50 ` [PATCH 00/11] mmc: sdhci: Cleanup assignment/definition of PM ops Ulf Hansson
2016-07-28 10:27   ` Jaehoon Chung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.