public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: Convert aat2870 to dev_pm_ops
@ 2011-12-28 17:40 Mark Brown
  2011-12-29  5:44 ` Jin Park
  2012-01-08 23:25 ` Samuel Ortiz
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Brown @ 2011-12-28 17:40 UTC (permalink / raw)
  To: Samuel Ortiz, Jin Park; +Cc: linux-kernel, Mark Brown

The I2C suspend and resume functions have been deprecated since the driver
was introduced.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/aat2870-core.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index e6da563..3aa36eb 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -468,9 +468,10 @@ static int aat2870_i2c_remove(struct i2c_client *client)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int aat2870_i2c_suspend(struct device *dev)
 {
+	struct i2c_client *client = to_i2c_client(dev);
 	struct aat2870_data *aat2870 = i2c_get_clientdata(client);
 
 	aat2870_disable(aat2870);
@@ -478,8 +479,9 @@ static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state)
 	return 0;
 }
 
-static int aat2870_i2c_resume(struct i2c_client *client)
+static int aat2870_i2c_resume(struct device *dev)
 {
+	struct i2c_client *client = to_i2c_client(dev);
 	struct aat2870_data *aat2870 = i2c_get_clientdata(client);
 	struct aat2870_register *reg = NULL;
 	int i;
@@ -495,10 +497,10 @@ static int aat2870_i2c_resume(struct i2c_client *client)
 
 	return 0;
 }
-#else
-#define aat2870_i2c_suspend	NULL
-#define aat2870_i2c_resume	NULL
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
+
+static SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
+			 aat2870_i2c_resume);
 
 static const struct i2c_device_id aat2870_i2c_id_table[] = {
 	{ "aat2870", 0 },
@@ -510,11 +512,10 @@ static struct i2c_driver aat2870_i2c_driver = {
 	.driver = {
 		.name	= "aat2870",
 		.owner	= THIS_MODULE,
+		.pm	= &aat2870_pm_ops,
 	},
 	.probe		= aat2870_i2c_probe,
 	.remove		= aat2870_i2c_remove,
-	.suspend	= aat2870_i2c_suspend,
-	.resume		= aat2870_i2c_resume,
 	.id_table	= aat2870_i2c_id_table,
 };
 
-- 
1.7.7.3


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

* Re: [PATCH] mfd: Convert aat2870 to dev_pm_ops
  2011-12-28 17:40 [PATCH] mfd: Convert aat2870 to dev_pm_ops Mark Brown
@ 2011-12-29  5:44 ` Jin Park
  2012-01-08 23:25 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Jin Park @ 2011-12-29  5:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Samuel Ortiz, linux-kernel@vger.kernel.org

Acked-by: Jin Park <jinyoungp@nvidia.com>

On 2011-12-29 오전 2:40, Mark Brown wrote:
> The I2C suspend and resume functions have been deprecated since the driver
> was introduced.
>
> Signed-off-by: Mark Brown<broonie@opensource.wolfsonmicro.com>
> ---
>   drivers/mfd/aat2870-core.c |   19 ++++++++++---------
>   1 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
> index e6da563..3aa36eb 100644
> --- a/drivers/mfd/aat2870-core.c
> +++ b/drivers/mfd/aat2870-core.c
> @@ -468,9 +468,10 @@ static int aat2870_i2c_remove(struct i2c_client *client)
>   	return 0;
>   }
>
> -#ifdef CONFIG_PM
> -static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state)
> +#ifdef CONFIG_PM_SLEEP
> +static int aat2870_i2c_suspend(struct device *dev)
>   {
> +	struct i2c_client *client = to_i2c_client(dev);
>   	struct aat2870_data *aat2870 = i2c_get_clientdata(client);
>
>   	aat2870_disable(aat2870);
> @@ -478,8 +479,9 @@ static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state)
>   	return 0;
>   }
>
> -static int aat2870_i2c_resume(struct i2c_client *client)
> +static int aat2870_i2c_resume(struct device *dev)
>   {
> +	struct i2c_client *client = to_i2c_client(dev);
>   	struct aat2870_data *aat2870 = i2c_get_clientdata(client);
>   	struct aat2870_register *reg = NULL;
>   	int i;
> @@ -495,10 +497,10 @@ static int aat2870_i2c_resume(struct i2c_client *client)
>
>   	return 0;
>   }
> -#else
> -#define aat2870_i2c_suspend	NULL
> -#define aat2870_i2c_resume	NULL
> -#endif /* CONFIG_PM */
> +#endif /* CONFIG_PM_SLEEP */
> +
> +static SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
> +			 aat2870_i2c_resume);
>
>   static const struct i2c_device_id aat2870_i2c_id_table[] = {
>   	{ "aat2870", 0 },
> @@ -510,11 +512,10 @@ static struct i2c_driver aat2870_i2c_driver = {
>   	.driver = {
>   		.name	= "aat2870",
>   		.owner	= THIS_MODULE,
> +		.pm	=&aat2870_pm_ops,
>   	},
>   	.probe		= aat2870_i2c_probe,
>   	.remove		= aat2870_i2c_remove,
> -	.suspend	= aat2870_i2c_suspend,
> -	.resume		= aat2870_i2c_resume,
>   	.id_table	= aat2870_i2c_id_table,
>   };
>

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

* Re: [PATCH] mfd: Convert aat2870 to dev_pm_ops
  2011-12-28 17:40 [PATCH] mfd: Convert aat2870 to dev_pm_ops Mark Brown
  2011-12-29  5:44 ` Jin Park
@ 2012-01-08 23:25 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2012-01-08 23:25 UTC (permalink / raw)
  To: Mark Brown; +Cc: Jin Park, linux-kernel

Hi Mark,

On Wed, Dec 28, 2011 at 05:40:28PM +0000, Mark Brown wrote:
> The I2C suspend and resume functions have been deprecated since the driver
> was introduced.
Patch applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

end of thread, other threads:[~2012-01-08 23:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-28 17:40 [PATCH] mfd: Convert aat2870 to dev_pm_ops Mark Brown
2011-12-29  5:44 ` Jin Park
2012-01-08 23:25 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox