diff mbox

[5/5] ks8851: Remove unneeded PM_OPS definitions

Message ID 1366140511-3836-5-git-send-email-fabio.estevam@freescale.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Fabio Estevam April 16, 2013, 7:28 p.m. UTC
SIMPLE_DEV_PM_OPS macro can handle !CONFIG_PM_SLEEP case nicely, so there is no
need to define PM_OPS for both CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP cases.

Remove the unneeded definitions.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/net/ethernet/micrel/ks8851.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Lars-Peter Clausen April 16, 2013, 8:29 p.m. UTC | #1
On 04/16/2013 09:28 PM, Fabio Estevam wrote:
> SIMPLE_DEV_PM_OPS macro can handle !CONFIG_PM_SLEEP case nicely, so there is no
> need to define PM_OPS for both CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP cases.
> 
> Remove the unneeded definitions.
> 
> Cc: Lars-Peter Clausen <lars@metafoo.de>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

yea, but now you have the dev_pm_ops struct, even if pm is disabled.

- Lars

> ---
>  drivers/net/ethernet/micrel/ks8851.c |    8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
> index da64960..727b546a 100644
> --- a/drivers/net/ethernet/micrel/ks8851.c
> +++ b/drivers/net/ethernet/micrel/ks8851.c
> @@ -1391,13 +1391,9 @@ static int ks8851_resume(struct device *dev)
>  
>  	return 0;
>  }
> +#endif
>  
>  static SIMPLE_DEV_PM_OPS(ks8851_pm_ops, ks8851_suspend, ks8851_resume);
> -#define KS8851_PM_OPS (&ks8851_pm_ops)
> -
> -#else
> -#define KS8851_PM_OPS NULL
> -#endif
>  
>  static int ks8851_probe(struct spi_device *spi)
>  {
> @@ -1536,7 +1532,7 @@ static struct spi_driver ks8851_driver = {
>  	.driver = {
>  		.name = "ks8851",
>  		.owner = THIS_MODULE,
> -		.pm = KS8851_PM_OPS,
> +		.pm = &ks8851_pm_ops,
>  	},
>  	.probe = ks8851_probe,
>  	.remove = ks8851_remove,

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller April 16, 2013, 8:37 p.m. UTC | #2
From: Lars-Peter Clausen <lars@metafoo.de>
Date: Tue, 16 Apr 2013 22:29:37 +0200

> On 04/16/2013 09:28 PM, Fabio Estevam wrote:
>> SIMPLE_DEV_PM_OPS macro can handle !CONFIG_PM_SLEEP case nicely, so there is no
>> need to define PM_OPS for both CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP cases.
>> 
>> Remove the unneeded definitions.
>> 
>> Cc: Lars-Peter Clausen <lars@metafoo.de>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> 
> yea, but now you have the dev_pm_ops struct, even if pm is disabled.

That's fine, it allows the functions to be compile tested in all
configurations.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lars-Peter Clausen April 17, 2013, 6:27 a.m. UTC | #3
On 04/16/2013 10:37 PM, David Miller wrote:
> From: Lars-Peter Clausen <lars@metafoo.de>
> Date: Tue, 16 Apr 2013 22:29:37 +0200
> 
>> On 04/16/2013 09:28 PM, Fabio Estevam wrote:
>>> SIMPLE_DEV_PM_OPS macro can handle !CONFIG_PM_SLEEP case nicely, so there is no
>>> need to define PM_OPS for both CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP cases.
>>>
>>> Remove the unneeded definitions.
>>>
>>> Cc: Lars-Peter Clausen <lars@metafoo.de>
>>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> yea, but now you have the dev_pm_ops struct, even if pm is disabled.
> 
> That's fine, it allows the functions to be compile tested in all
> configurations.

The functions are still protected by a #ifdef, it's just the dev_pm_ops struct
which is not anymore.

- Lars
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index da64960..727b546a 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -1391,13 +1391,9 @@  static int ks8851_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(ks8851_pm_ops, ks8851_suspend, ks8851_resume);
-#define KS8851_PM_OPS (&ks8851_pm_ops)
-
-#else
-#define KS8851_PM_OPS NULL
-#endif
 
 static int ks8851_probe(struct spi_device *spi)
 {
@@ -1536,7 +1532,7 @@  static struct spi_driver ks8851_driver = {
 	.driver = {
 		.name = "ks8851",
 		.owner = THIS_MODULE,
-		.pm = KS8851_PM_OPS,
+		.pm = &ks8851_pm_ops,
 	},
 	.probe = ks8851_probe,
 	.remove = ks8851_remove,