linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Fabio Estevam <fabio.estevam@freescale.com>
Cc: linux-can@vger.kernel.org
Subject: Re: [PATCH] can: flexcan: Use SIMPLE_DEV_PM_OPS
Date: Mon, 20 May 2013 20:47:08 +0200	[thread overview]
Message-ID: <519A6FAC.6080803@pengutronix.de> (raw)
In-Reply-To: <1369075423-12792-1-git-send-email-fabio.estevam@freescale.com>

[-- Attachment #1: Type: text/plain, Size: 2364 bytes --]

On 05/20/2013 08:43 PM, Fabio Estevam wrote:
> Using SIMPLE_DEV_PM_OPS can make the code smaller and simpler.
>     
> Also change CONFIG_PM to CONFIG_PM_SLEEP.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/net/can/flexcan.c | 20 +++++++++-----------
>  1 file changed, 9 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index 4a40a18..d85d9ff 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -1137,10 +1137,10 @@ static int flexcan_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM
> -static int flexcan_suspend(struct platform_device *pdev, pm_message_t state)
> +#ifdef CONFIG_PM_SLEEP
> +static int flexcan_suspend(struct device *device)
>  {
> -	struct net_device *dev = platform_get_drvdata(pdev);
> +	struct net_device *dev = dev_get_drvdata(device);
>  	struct flexcan_priv *priv = netdev_priv(dev);
>  
>  	flexcan_chip_disable(priv);
> @@ -1154,9 +1154,9 @@ static int flexcan_suspend(struct platform_device *pdev, pm_message_t state)
>  	return 0;
>  }
>  
> -static int flexcan_resume(struct platform_device *pdev)
> +static int flexcan_resume(struct device *device)
>  {
> -	struct net_device *dev = platform_get_drvdata(pdev);
> +	struct net_device *dev = dev_get_drvdata(device);
>  	struct flexcan_priv *priv = netdev_priv(dev);
>  
>  	priv->can.state = CAN_STATE_ERROR_ACTIVE;
> @@ -1168,21 +1168,19 @@ static int flexcan_resume(struct platform_device *pdev)
>  
>  	return 0;
>  }
> -#else
> -#define flexcan_suspend NULL
> -#define flexcan_resume NULL
> -#endif
> +#endif /* CONFIG_PM_SLEEP */
> +
> +static SIMPLE_DEV_PM_OPS(flexcan_pm_ops, flexcan_suspend, flexcan_resume);
>  
>  static struct platform_driver flexcan_driver = {
>  	.driver = {
>  		.name = DRV_NAME,
>  		.owner = THIS_MODULE,
> +		.pm	= &flexcan_pm_ops,

Please just indent with one space after ".pm". No need to resend, I'll
fix it while applying it to linux-can-next.

tnx, Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

      reply	other threads:[~2013-05-20 18:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 18:43 [PATCH] can: flexcan: Use SIMPLE_DEV_PM_OPS Fabio Estevam
2013-05-20 18:47 ` Marc Kleine-Budde [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519A6FAC.6080803@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=fabio.estevam@freescale.com \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).