linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mmc: dw_mmc: use the dev_pm_ops for dw_mmc controller
@ 2011-12-01  0:16 Jaehoon Chung
  2011-12-01  9:59 ` James Hogan
  0 siblings, 1 reply; 3+ messages in thread
From: Jaehoon Chung @ 2011-12-01  0:16 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, James Hogan, Will Newton, Kyungmin Park

Dw_mmc controller didn't use dev_pm_ops.
This patch modified to use the dev_mp_ops for dw_mmc controller

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changelog v2:
	- Use the Macro for dev_pm_ops

 drivers/mmc/host/dw_mmc.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 3aaeb08..2ba1a96 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2066,10 +2066,10 @@ static int __exit dw_mci_remove(struct platform_device *pdev)
 /*
  * TODO: we should probably disable the clock to the card in the suspend path.
  */
-static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg)
+static int dw_mci_suspend(struct device *dev)
 {
 	int i, ret;
-	struct dw_mci *host = platform_get_drvdata(pdev);
+	struct dw_mci *host = dev_get_drvdata(dev);
 
 	for (i = 0; i < host->num_slots; i++) {
 		struct dw_mci_slot *slot = host->slot[i];
@@ -2092,10 +2092,10 @@ static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg)
 	return 0;
 }
 
-static int dw_mci_resume(struct platform_device *pdev)
+static int dw_mci_resume(struct device *dev)
 {
 	int i, ret;
-	struct dw_mci *host = platform_get_drvdata(pdev);
+	struct dw_mci *host = dev_get_drvdata(dev);
 
 	if (host->vmmc)
 		regulator_enable(host->vmmc);
@@ -2103,7 +2103,7 @@ static int dw_mci_resume(struct platform_device *pdev)
 	if (host->dma_ops->init)
 		host->dma_ops->init(host);
 
-	if (!mci_wait_reset(&pdev->dev, host)) {
+	if (!mci_wait_reset(dev, host)) {
 		ret = -ENODEV;
 		return ret;
 	}
@@ -2133,12 +2133,13 @@ static int dw_mci_resume(struct platform_device *pdev)
 #define dw_mci_resume	NULL
 #endif /* CONFIG_PM */
 
+SIMPLE_DEV_PM_OPS(dw_mci_pmops, dw_mci_suspend, dw_mci_resume);
+
 static struct platform_driver dw_mci_driver = {
 	.remove		= __exit_p(dw_mci_remove),
-	.suspend	= dw_mci_suspend,
-	.resume		= dw_mci_resume,
 	.driver		= {
 		.name		= "dw_mmc",
+		.pm		= &dw_mci_pmops,
 	},
 };
 

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

* Re: [PATCH v2] mmc: dw_mmc: use the dev_pm_ops for dw_mmc controller
  2011-12-01  0:16 [PATCH v2] mmc: dw_mmc: use the dev_pm_ops for dw_mmc controller Jaehoon Chung
@ 2011-12-01  9:59 ` James Hogan
  2011-12-02  1:01   ` Jaehoon Chung
  0 siblings, 1 reply; 3+ messages in thread
From: James Hogan @ 2011-12-01  9:59 UTC (permalink / raw)
  To: Jaehoon Chung; +Cc: linux-mmc, Chris Ball, Will Newton, Kyungmin Park

Thanks,

Couple more things

On 12/01/2011 12:16 AM, Jaehoon Chung wrote:
> Dw_mmc controller didn't use dev_pm_ops.
> This patch modified to use the dev_mp_ops for dw_mmc controller

I think you mean dev_pm_ops.

> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> Changelog v2:
> 	- Use the Macro for dev_pm_ops
> 
>  drivers/mmc/host/dw_mmc.c |   15 ++++++++-------
>  1 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 3aaeb08..2ba1a96 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2066,10 +2066,10 @@ static int __exit dw_mci_remove(struct platform_device *pdev)
>  /*
>   * TODO: we should probably disable the clock to the card in the suspend path.
>   */
> -static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg)
> +static int dw_mci_suspend(struct device *dev)
>  {
>  	int i, ret;
> -	struct dw_mci *host = platform_get_drvdata(pdev);
> +	struct dw_mci *host = dev_get_drvdata(dev);
>  
>  	for (i = 0; i < host->num_slots; i++) {
>  		struct dw_mci_slot *slot = host->slot[i];
> @@ -2092,10 +2092,10 @@ static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg)
>  	return 0;
>  }
>  
> -static int dw_mci_resume(struct platform_device *pdev)
> +static int dw_mci_resume(struct device *dev)
>  {
>  	int i, ret;
> -	struct dw_mci *host = platform_get_drvdata(pdev);
> +	struct dw_mci *host = dev_get_drvdata(dev);
>  
>  	if (host->vmmc)
>  		regulator_enable(host->vmmc);
> @@ -2103,7 +2103,7 @@ static int dw_mci_resume(struct platform_device *pdev)
>  	if (host->dma_ops->init)
>  		host->dma_ops->init(host);
>  
> -	if (!mci_wait_reset(&pdev->dev, host)) {
> +	if (!mci_wait_reset(dev, host)) {
>  		ret = -ENODEV;
>  		return ret;
>  	}
> @@ -2133,12 +2133,13 @@ static int dw_mci_resume(struct platform_device *pdev)
>  #define dw_mci_resume	NULL
>  #endif /* CONFIG_PM */
>  
> +SIMPLE_DEV_PM_OPS(dw_mci_pmops, dw_mci_suspend, dw_mci_resume);

This could be static (e.g. see drivers/input/keyboard/gpio_keys.c).

I get:
drivers/mmc/host/dw_mmc.c:2069: warning: ‘dw_mci_suspend’ defined but
not used
drivers/mmc/host/dw_mmc.c:2095: warning: ‘dw_mci_resume’ defined but not
used

when CONFIG_PM=y and CONFIG_PM_SLEEP=n (CONFIG_SUSPEND=n), because the
#ifdef above needs to change to CONFIG_PM_SLEEP (see
SET_SYSTEM_SLEEP_PM_OPS in include/linux/pm.h).

> +
>  static struct platform_driver dw_mci_driver = {
>  	.remove		= __exit_p(dw_mci_remove),
> -	.suspend	= dw_mci_suspend,
> -	.resume		= dw_mci_resume,
>  	.driver		= {
>  		.name		= "dw_mmc",
> +		.pm		= &dw_mci_pmops,
>  	},
>  };
>  

Cheers
James


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

* Re: [PATCH v2] mmc: dw_mmc: use the dev_pm_ops for dw_mmc controller
  2011-12-01  9:59 ` James Hogan
@ 2011-12-02  1:01   ` Jaehoon Chung
  0 siblings, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2011-12-02  1:01 UTC (permalink / raw)
  To: James Hogan
  Cc: Jaehoon Chung, linux-mmc, Chris Ball, Will Newton, Kyungmin Park

Thanks, James..

I will check your comment and resend the patch..

Best Regards,
Jaehoon Chung

On 12/01/2011 06:59 PM, James Hogan wrote:

> Thanks,
> 
> Couple more things
> 
> On 12/01/2011 12:16 AM, Jaehoon Chung wrote:
>> Dw_mmc controller didn't use dev_pm_ops.
>> This patch modified to use the dev_mp_ops for dw_mmc controller
> 
> I think you mean dev_pm_ops.
> 
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>> Changelog v2:
>> 	- Use the Macro for dev_pm_ops
>>
>>  drivers/mmc/host/dw_mmc.c |   15 ++++++++-------
>>  1 files changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 3aaeb08..2ba1a96 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -2066,10 +2066,10 @@ static int __exit dw_mci_remove(struct platform_device *pdev)
>>  /*
>>   * TODO: we should probably disable the clock to the card in the suspend path.
>>   */
>> -static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg)
>> +static int dw_mci_suspend(struct device *dev)
>>  {
>>  	int i, ret;
>> -	struct dw_mci *host = platform_get_drvdata(pdev);
>> +	struct dw_mci *host = dev_get_drvdata(dev);
>>  
>>  	for (i = 0; i < host->num_slots; i++) {
>>  		struct dw_mci_slot *slot = host->slot[i];
>> @@ -2092,10 +2092,10 @@ static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg)
>>  	return 0;
>>  }
>>  
>> -static int dw_mci_resume(struct platform_device *pdev)
>> +static int dw_mci_resume(struct device *dev)
>>  {
>>  	int i, ret;
>> -	struct dw_mci *host = platform_get_drvdata(pdev);
>> +	struct dw_mci *host = dev_get_drvdata(dev);
>>  
>>  	if (host->vmmc)
>>  		regulator_enable(host->vmmc);
>> @@ -2103,7 +2103,7 @@ static int dw_mci_resume(struct platform_device *pdev)
>>  	if (host->dma_ops->init)
>>  		host->dma_ops->init(host);
>>  
>> -	if (!mci_wait_reset(&pdev->dev, host)) {
>> +	if (!mci_wait_reset(dev, host)) {
>>  		ret = -ENODEV;
>>  		return ret;
>>  	}
>> @@ -2133,12 +2133,13 @@ static int dw_mci_resume(struct platform_device *pdev)
>>  #define dw_mci_resume	NULL
>>  #endif /* CONFIG_PM */
>>  
>> +SIMPLE_DEV_PM_OPS(dw_mci_pmops, dw_mci_suspend, dw_mci_resume);
> 
> This could be static (e.g. see drivers/input/keyboard/gpio_keys.c).
> 
> I get:
> drivers/mmc/host/dw_mmc.c:2069: warning: ‘dw_mci_suspend’ defined but
> not used
> drivers/mmc/host/dw_mmc.c:2095: warning: ‘dw_mci_resume’ defined but not
> used
> 
> when CONFIG_PM=y and CONFIG_PM_SLEEP=n (CONFIG_SUSPEND=n), because the
> #ifdef above needs to change to CONFIG_PM_SLEEP (see
> SET_SYSTEM_SLEEP_PM_OPS in include/linux/pm.h).
> 
>> +
>>  static struct platform_driver dw_mci_driver = {
>>  	.remove		= __exit_p(dw_mci_remove),
>> -	.suspend	= dw_mci_suspend,
>> -	.resume		= dw_mci_resume,
>>  	.driver		= {
>>  		.name		= "dw_mmc",
>> +		.pm		= &dw_mci_pmops,
>>  	},
>>  };
>>  
> 
> Cheers
> James
> 
> --
> 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] 3+ messages in thread

end of thread, other threads:[~2011-12-02  1:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01  0:16 [PATCH v2] mmc: dw_mmc: use the dev_pm_ops for dw_mmc controller Jaehoon Chung
2011-12-01  9:59 ` James Hogan
2011-12-02  1:01   ` Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).