2012-10-16 14:59:03

by Yuanhan Liu

[permalink] [raw]
Subject: [PATCH 1/5] ata: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

This will fix warnings like following when CONFIG_PM_SLEEP is not set:

warning: 'xxx_suspend' defined but not used [-Wunused-function]
warning: 'xxx_resume' defined but not used [-Wunused-function]

Because
SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)

Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM).

Cc: Jeff Garzik <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: [email protected]
Signed-off-by: Yuanhan Liu <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
---
drivers/ata/ahci_platform.c | 2 +-
drivers/ata/pata_arasan_cf.c | 2 +-
drivers/ata/sata_highbank.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index b1ae480..b7078af 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -238,7 +238,7 @@ static int __devexit ahci_remove(struct platform_device *pdev)
return 0;
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int ahci_suspend(struct device *dev)
{
struct ahci_platform_data *pdata = dev_get_platdata(dev);
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index 26201eb..3fe2f66 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -908,7 +908,7 @@ static int __devexit arasan_cf_remove(struct platform_device *pdev)
return 0;
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int arasan_cf_suspend(struct device *dev)
{
struct ata_host *host = dev_get_drvdata(dev);
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index 0d7c4c2..b045b19 100644
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -378,7 +378,7 @@ static int __devexit ahci_highbank_remove(struct platform_device *pdev)
return 0;
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int ahci_highbank_suspend(struct device *dev)
{
struct ata_host *host = dev_get_drvdata(dev);
--
1.7.7.6


2012-10-16 14:59:06

by Yuanhan Liu

[permalink] [raw]
Subject: [PATCH 2/5] bcma: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

This will fix warnings like following when CONFIG_PM_SLEEP is not set:

warning: 'xxx_suspend' defined but not used [-Wunused-function]
warning: 'xxx_resume' defined but not used [-Wunused-function]

Because
SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)

Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM).

Cc: John W. Linville <[email protected]>
Cc: "Rafał Miłecki" <[email protected]>
Cc: [email protected]
Signed-off-by: Yuanhan Liu <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
---
drivers/bcma/host_pci.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index b6b4b5e..98fdc3e 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -238,7 +238,7 @@ static void __devexit bcma_host_pci_remove(struct pci_dev *dev)
pci_set_drvdata(dev, NULL);
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int bcma_host_pci_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
@@ -261,11 +261,11 @@ static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend,
bcma_host_pci_resume);
#define BCMA_PM_OPS (&bcma_pm_ops)

-#else /* CONFIG_PM */
+#else /* CONFIG_PM_SLEEP */

#define BCMA_PM_OPS NULL

-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */

static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
--
1.7.7.6

2012-10-16 14:59:10

by Yuanhan Liu

[permalink] [raw]
Subject: [PATCH 5/5] crypto: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

This will fix warnings like following when CONFIG_PM_SLEEP is not set:

warning: 'xxx_suspend' defined but not used [-Wunused-function]
warning: 'xxx_resume' defined but not used [-Wunused-function]

Cc: Herbert Xu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Signed-off-by: Yuanhan Liu <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
---
drivers/crypto/ux500/cryp/cryp_core.c | 2 ++
drivers/crypto/ux500/hash/hash_core.c | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c
index bc615cc..21b50ea 100644
--- a/drivers/crypto/ux500/cryp/cryp_core.c
+++ b/drivers/crypto/ux500/cryp/cryp_core.c
@@ -1662,6 +1662,7 @@ static void ux500_cryp_shutdown(struct platform_device *pdev)

}

+#ifdef CONFIG_PM_SLEEP
static int ux500_cryp_suspend(struct device *dev)
{
int ret;
@@ -1742,6 +1743,7 @@ static int ux500_cryp_resume(struct device *dev)

return ret;
}
+#endif

static SIMPLE_DEV_PM_OPS(ux500_cryp_pm, ux500_cryp_suspend, ux500_cryp_resume);

diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c
index 632c333..906559f 100644
--- a/drivers/crypto/ux500/hash/hash_core.c
+++ b/drivers/crypto/ux500/hash/hash_core.c
@@ -1892,6 +1892,7 @@ static void ux500_hash_shutdown(struct platform_device *pdev)
__func__);
}

+#ifdef CONFIG_PM_SLEEP
/**
* ux500_hash_suspend - Function that suspends the hash device.
* @dev: Device to suspend.
@@ -1959,6 +1960,7 @@ static int ux500_hash_resume(struct device *dev)

return ret;
}
+#endif

static SIMPLE_DEV_PM_OPS(ux500_hash_pm, ux500_hash_suspend, ux500_hash_resume);

--
1.7.7.6

2012-10-16 14:59:42

by Yuanhan Liu

[permalink] [raw]
Subject: [PATCH 3/5] mg_disk: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

This will fix warnings like following when CONFIG_PM_SLEEP is not set:

warning: 'xxx_suspend' defined but not used [-Wunused-function]
warning: 'xxx_resume' defined but not used [-Wunused-function]

Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: Yuanhan Liu <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
---
drivers/block/mg_disk.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 1788f491..532bb89 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -780,6 +780,7 @@ static const struct block_device_operations mg_disk_ops = {
.getgeo = mg_getgeo
};

+#ifdef CONFIG_PM_SLEEP
static int mg_suspend(struct device *dev)
{
struct mg_drv_data *prv_data = dev->platform_data;
@@ -824,6 +825,7 @@ static int mg_resume(struct device *dev)

return 0;
}
+#endif

static SIMPLE_DEV_PM_OPS(mg_pm, mg_suspend, mg_resume);

--
1.7.7.6

2012-10-16 14:59:41

by Yuanhan Liu

[permalink] [raw]
Subject: [PATCH 4/5] sonypi: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

This will fix warnings like following when CONFIG_PM_SLEEP is not set:

warning: 'xxx_suspend' defined but not used [-Wunused-function]
warning: 'xxx_resume' defined but not used [-Wunused-function]

Because
SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)

Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM).

Cc: Mattia Dongili <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Yuanhan Liu <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
---
drivers/char/sonypi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 320debb..9b4f011 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1456,7 +1456,7 @@ static int __devexit sonypi_remove(struct platform_device *dev)
return 0;
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int old_camera_power;

static int sonypi_suspend(struct device *dev)
--
1.7.7.6

2012-10-16 15:04:45

by Fengguang Wu

[permalink] [raw]
Subject: Re: [PATCH 1/5] ata: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

// Add CC to PM list

On Tue, Oct 16, 2012 at 10:59:01PM +0800, Yuanhan Liu wrote:
> This will fix warnings like following when CONFIG_PM_SLEEP is not set:
>
> warning: 'xxx_suspend' defined but not used [-Wunused-function]
> warning: 'xxx_resume' defined but not used [-Wunused-function]
>
> Because
> SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
>
> Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM).
>
> Cc: Jeff Garzik <[email protected]>
> Cc: Viresh Kumar <[email protected]>
> Cc: [email protected]
> Signed-off-by: Yuanhan Liu <[email protected]>
> Signed-off-by: Fengguang Wu <[email protected]>
> ---
> drivers/ata/ahci_platform.c | 2 +-
> drivers/ata/pata_arasan_cf.c | 2 +-
> drivers/ata/sata_highbank.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> index b1ae480..b7078af 100644
> --- a/drivers/ata/ahci_platform.c
> +++ b/drivers/ata/ahci_platform.c
> @@ -238,7 +238,7 @@ static int __devexit ahci_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
> static int ahci_suspend(struct device *dev)
> {
> struct ahci_platform_data *pdata = dev_get_platdata(dev);
> diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
> index 26201eb..3fe2f66 100644
> --- a/drivers/ata/pata_arasan_cf.c
> +++ b/drivers/ata/pata_arasan_cf.c
> @@ -908,7 +908,7 @@ static int __devexit arasan_cf_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
> static int arasan_cf_suspend(struct device *dev)
> {
> struct ata_host *host = dev_get_drvdata(dev);
> diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
> index 0d7c4c2..b045b19 100644
> --- a/drivers/ata/sata_highbank.c
> +++ b/drivers/ata/sata_highbank.c
> @@ -378,7 +378,7 @@ static int __devexit ahci_highbank_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
> static int ahci_highbank_suspend(struct device *dev)
> {
> struct ata_host *host = dev_get_drvdata(dev);
> --
> 1.7.7.6

2012-10-17 03:39:44

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 1/5] ata: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

On Tue, Oct 16, 2012 at 8:29 PM, Yuanhan Liu
<[email protected]> wrote:
> This will fix warnings like following when CONFIG_PM_SLEEP is not set:
>
> warning: 'xxx_suspend' defined but not used [-Wunused-function]
> warning: 'xxx_resume' defined but not used [-Wunused-function]
>
> Because
> SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
>
> Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM).
>
> Cc: Jeff Garzik <[email protected]>
> Cc: Viresh Kumar <[email protected]>
> Cc: [email protected]
> Signed-off-by: Yuanhan Liu <[email protected]>
> Signed-off-by: Fengguang Wu <[email protected]>
> ---
> drivers/ata/ahci_platform.c | 2 +-
> drivers/ata/pata_arasan_cf.c | 2 +-

For pata_arasan:

Acked-by: Viresh Kumar <[email protected]>

--
viresh

2012-11-16 05:48:17

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH 1/5] ata: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

On 10/16/2012 10:59 AM, Yuanhan Liu wrote:
> This will fix warnings like following when CONFIG_PM_SLEEP is not set:
>
> warning: 'xxx_suspend' defined but not used [-Wunused-function]
> warning: 'xxx_resume' defined but not used [-Wunused-function]
>
> Because
> SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
>
> Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM).
>
> Cc: Jeff Garzik <[email protected]>
> Cc: Viresh Kumar <[email protected]>
> Cc: [email protected]
> Signed-off-by: Yuanhan Liu <[email protected]>
> Signed-off-by: Fengguang Wu <[email protected]>
> ---
> drivers/ata/ahci_platform.c | 2 +-
> drivers/ata/pata_arasan_cf.c | 2 +-
> drivers/ata/sata_highbank.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)


applied