* [PATCH] arm: Convert sa1111 platform and bus legacy pm_ops to dev_pm_ops
@ 2013-07-05 22:44 Shuah Khan
2013-07-05 22:48 ` Sergei Shtylyov
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Shuah Khan @ 2013-07-05 22:44 UTC (permalink / raw)
To: linux-arm-kernel
Convert arch/arm/common/sa1111 platform and bus legacy pm_ops to dev_pm_ops.
This change also updates the use of COMFIG_PM to CONFIG_PM_SLEEP as this
platform and bus code implements PM_SLEEP ops and not the PM_RUNTIME ops.
Compile tested.
Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
arch/arm/common/sa1111.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 2a64c12..95594f0 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -1321,7 +1321,7 @@ static int sa1111_bus_resume(struct device *dev)
}
static SIMPLE_DEV_PM_OPS(sa1111_bus_dev_pm_ops, sa1111_bus_suspend,
sa1111_bus_resume);
-#endif
+#endif
static void sa1111_bus_shutdown(struct device *dev)
{
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] arm: Convert sa1111 platform and bus legacy pm_ops to dev_pm_ops
2013-07-05 22:44 [PATCH] arm: Convert sa1111 platform and bus legacy pm_ops to dev_pm_ops Shuah Khan
@ 2013-07-05 22:48 ` Sergei Shtylyov
2013-07-05 22:48 ` Russell King - ARM Linux
2013-07-05 22:49 ` Shuah Khan
2 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2013-07-05 22:48 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 07/06/2013 02:44 AM, Shuah Khan wrote:
> Convert arch/arm/common/sa1111 platform and bus legacy pm_ops to dev_pm_ops.
> This change also updates the use of COMFIG_PM to CONFIG_PM_SLEEP as this
> platform and bus code implements PM_SLEEP ops and not the PM_RUNTIME ops.
> Compile tested.
It may be compile tested but the patch description doesn't match the
patch (which is a simple trailing space fix).
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> ---
> arch/arm/common/sa1111.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
> index 2a64c12..95594f0 100644
> --- a/arch/arm/common/sa1111.c
> +++ b/arch/arm/common/sa1111.c
> @@ -1321,7 +1321,7 @@ static int sa1111_bus_resume(struct device *dev)
> }
> static SIMPLE_DEV_PM_OPS(sa1111_bus_dev_pm_ops, sa1111_bus_suspend,
> sa1111_bus_resume);
> -#endif
> +#endif
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] arm: Convert sa1111 platform and bus legacy pm_ops to dev_pm_ops
2013-07-05 22:44 [PATCH] arm: Convert sa1111 platform and bus legacy pm_ops to dev_pm_ops Shuah Khan
2013-07-05 22:48 ` Sergei Shtylyov
@ 2013-07-05 22:48 ` Russell King - ARM Linux
2013-07-05 22:49 ` Shuah Khan
2 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-07-05 22:48 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jul 05, 2013 at 04:44:57PM -0600, Shuah Khan wrote:
> Convert arch/arm/common/sa1111 platform and bus legacy pm_ops to dev_pm_ops.
> This change also updates the use of COMFIG_PM to CONFIG_PM_SLEEP as this
> platform and bus code implements PM_SLEEP ops and not the PM_RUNTIME ops.
> Compile tested.
Err...
> diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
> index 2a64c12..95594f0 100644
> --- a/arch/arm/common/sa1111.c
> +++ b/arch/arm/common/sa1111.c
> @@ -1321,7 +1321,7 @@ static int sa1111_bus_resume(struct device *dev)
> }
> static SIMPLE_DEV_PM_OPS(sa1111_bus_dev_pm_ops, sa1111_bus_suspend,
> sa1111_bus_resume);
> -#endif
> +#endif
Patch doesn't match description.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] arm: Convert sa1111 platform and bus legacy pm_ops to dev_pm_ops
2013-07-05 22:44 [PATCH] arm: Convert sa1111 platform and bus legacy pm_ops to dev_pm_ops Shuah Khan
2013-07-05 22:48 ` Sergei Shtylyov
2013-07-05 22:48 ` Russell King - ARM Linux
@ 2013-07-05 22:49 ` Shuah Khan
2 siblings, 0 replies; 5+ messages in thread
From: Shuah Khan @ 2013-07-05 22:49 UTC (permalink / raw)
To: linux-arm-kernel
On 07/05/2013 04:45 PM, Shuah Khan wrote:
> Convert arch/arm/common/sa1111 platform and bus legacy pm_ops to dev_pm_ops.
> This change also updates the use of COMFIG_PM to CONFIG_PM_SLEEP as this
> platform and bus code implements PM_SLEEP ops and not the PM_RUNTIME ops.
> Compile tested.
>
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> ---
> arch/arm/common/sa1111.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
> index 2a64c12..95594f0 100644
> --- a/arch/arm/common/sa1111.c
> +++ b/arch/arm/common/sa1111.c
> @@ -1321,7 +1321,7 @@ static int sa1111_bus_resume(struct device *dev)
> }
> static SIMPLE_DEV_PM_OPS(sa1111_bus_dev_pm_ops, sa1111_bus_suspend,
> sa1111_bus_resume);
> -#endif
> +#endif
>
> static void sa1111_bus_shutdown(struct device *dev)
> {
>
Please ignore this patch - it is not correct.
-- Shuah
--
Shuah Khan, Linux Kernel Developer - Open Source Group Samsung Research
America (Silicon Valley) shuah.kh at samsung.com | (970) 672-0658
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] arm: Convert sa1111 platform and bus legacy pm_ops to dev_pm_ops
@ 2013-07-05 22:57 Shuah Khan
0 siblings, 0 replies; 5+ messages in thread
From: Shuah Khan @ 2013-07-05 22:57 UTC (permalink / raw)
To: linux-arm-kernel
Convert arch/arm/common/sa1111 platform and bus legacy pm_ops to dev_pm_ops.
This change also updates the use of COMFIG_PM to CONFIG_PM_SLEEP as this
platform and bus code implements PM_SLEEP ops and not the PM_RUNTIME ops.
Compile tested.
Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
arch/arm/common/sa1111.c | 39 ++++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index e57d7e5..95594f0 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -107,7 +107,7 @@ struct sa1111 {
spinlock_t lock;
void __iomem *base;
struct sa1111_platform_data *pdata;
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
void *saved_state;
#endif
};
@@ -870,11 +870,11 @@ struct sa1111_save_data {
unsigned int wakeen1;
};
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
-static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
+static int sa1111_suspend(struct device *dev)
{
- struct sa1111 *sachip = platform_get_drvdata(dev);
+ struct sa1111 *sachip = platform_get_drvdata(to_platform_device(dev));
struct sa1111_save_data *save;
unsigned long flags;
unsigned int val;
@@ -937,9 +937,10 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
* restored by their respective drivers, and must be called
* via LDM after this function.
*/
-static int sa1111_resume(struct platform_device *dev)
+static int sa1111_resume(struct device *dev)
{
- struct sa1111 *sachip = platform_get_drvdata(dev);
+ struct platform_device *pdev = to_platform_device(dev);
+ struct sa1111 *sachip = platform_get_drvdata(pdev);
struct sa1111_save_data *save;
unsigned long flags, id;
void __iomem *base;
@@ -955,7 +956,7 @@ static int sa1111_resume(struct platform_device *dev)
id = sa1111_readl(sachip->base + SA1111_SKID);
if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
__sa1111_remove(sachip);
- platform_set_drvdata(dev, NULL);
+ platform_set_drvdata(pdev, NULL);
kfree(save);
return 0;
}
@@ -1005,9 +1006,7 @@ static int sa1111_resume(struct platform_device *dev)
return 0;
}
-#else
-#define sa1111_suspend NULL
-#define sa1111_resume NULL
+static SIMPLE_DEV_PM_OPS(sa1111_dev_pm_ops, sa1111_suspend, sa1111_resume);
#endif
static int sa1111_probe(struct platform_device *pdev)
@@ -1030,7 +1029,7 @@ static int sa1111_remove(struct platform_device *pdev)
struct sa1111 *sachip = platform_get_drvdata(pdev);
if (sachip) {
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
kfree(sachip->saved_state);
sachip->saved_state = NULL;
#endif
@@ -1053,11 +1052,12 @@ static int sa1111_remove(struct platform_device *pdev)
static struct platform_driver sa1111_device_driver = {
.probe = sa1111_probe,
.remove = sa1111_remove,
- .suspend = sa1111_suspend,
- .resume = sa1111_resume,
.driver = {
.name = "sa1111",
.owner = THIS_MODULE,
+#ifdef CONFIG_PM_SLEEP
+ .pm = &sa1111_dev_pm_ops,
+#endif
},
};
@@ -1297,14 +1297,15 @@ static int sa1111_match(struct device *_dev, struct device_driver *_drv)
return dev->devid & drv->devid;
}
-static int sa1111_bus_suspend(struct device *dev, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int sa1111_bus_suspend(struct device *dev)
{
struct sa1111_dev *sadev = SA1111_DEV(dev);
struct sa1111_driver *drv = SA1111_DRV(dev->driver);
int ret = 0;
if (drv && drv->suspend)
- ret = drv->suspend(sadev, state);
+ ret = drv->suspend(sadev, PMSG_SUSPEND);
return ret;
}
@@ -1318,6 +1319,9 @@ static int sa1111_bus_resume(struct device *dev)
ret = drv->resume(sadev);
return ret;
}
+static SIMPLE_DEV_PM_OPS(sa1111_bus_dev_pm_ops, sa1111_bus_suspend,
+ sa1111_bus_resume);
+#endif
static void sa1111_bus_shutdown(struct device *dev)
{
@@ -1354,8 +1358,9 @@ struct bus_type sa1111_bus_type = {
.match = sa1111_match,
.probe = sa1111_bus_probe,
.remove = sa1111_bus_remove,
- .suspend = sa1111_bus_suspend,
- .resume = sa1111_bus_resume,
+#ifdef CONFIG_PM_SLEEP
+ .pm = &sa1111_bus_dev_pm_ops,
+#endif
.shutdown = sa1111_bus_shutdown,
};
EXPORT_SYMBOL(sa1111_bus_type);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-05 22:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-05 22:44 [PATCH] arm: Convert sa1111 platform and bus legacy pm_ops to dev_pm_ops Shuah Khan
2013-07-05 22:48 ` Sergei Shtylyov
2013-07-05 22:48 ` Russell King - ARM Linux
2013-07-05 22:49 ` Shuah Khan
-- strict thread matches above, loose matches on Subject: below --
2013-07-05 22:57 Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox