linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: w.sang@pengutronix.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] mxc_nand: fix PM
Date: Fri, 21 May 2010 15:10:58 +0200	[thread overview]
Message-ID: <20100521131058.GC27829@pengutronix.de> (raw)
In-Reply-To: <1274440363-435-2-git-send-email-eric@eukrea.com>

On Fri, May 21, 2010 at 01:12:40PM +0200, Eric B?nard wrote:

A short description what was fixed and how it was fixed would be great.

> Signed-off-by: Eric B?nard <eric@eukrea.com>
> ---
>  drivers/mtd/nand/mxc_nand.c |   27 ++++++++++-----------------
>  1 files changed, 10 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index fb03aff..5e51d4d 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -895,16 +895,13 @@ static int __devexit mxcnd_remove(struct platform_device *pdev)
>  #ifdef CONFIG_PM
>  static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
>  {
> -	struct mtd_info *mtd = platform_get_drvdata(pdev);
> -	struct nand_chip *nand_chip = mtd->priv;
> -	struct mxc_nand_host *host = nand_chip->priv;
> +	struct mxc_nand_host *host = platform_get_drvdata(pdev);
>  	int ret = 0;
>  
>  	DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");
> -	if (mtd) {
> -		ret = mtd->suspend(mtd);
> -		/* Disable the NFC clock */
> +	if (host->clk_act) {
>  		clk_disable(host->clk);
> +		host->clk_act = 0;
>  	}
>  
>  	return ret;
> @@ -912,31 +909,27 @@ static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
>  
>  static int mxcnd_resume(struct platform_device *pdev)
>  {
> -	struct mtd_info *mtd = platform_get_drvdata(pdev);
> -	struct nand_chip *nand_chip = mtd->priv;
> -	struct mxc_nand_host *host = nand_chip->priv;
> +	struct mxc_nand_host *host = platform_get_drvdata(pdev);
>  	int ret = 0;
>  
>  	DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n");
> -
> -	if (mtd) {
> -		/* Enable the NFC clock */
> +	if (!host->clk_act) {
>  		clk_enable(host->clk);
> -		mtd->resume(mtd);
> +		host->clk_act = 1;
>  	}
>  
>  	return ret;
>  }
>  
>  #else
> -# define mxcnd_suspend   NULL
> -# define mxcnd_resume    NULL
> -#endif				/* CONFIG_PM */
> +#define mxcnd_suspend	NULL
> +#define mxcnd_resume	NULL
> +#endif
>  
>  static struct platform_driver mxcnd_driver = {
>  	.driver = {
>  		   .name = DRIVER_NAME,
> -		   },
> +	},
>  	.remove = __devexit_p(mxcnd_remove),
>  	.suspend = mxcnd_suspend,
>  	.resume = mxcnd_resume,
> -- 
> 1.6.3.3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100521/49433094/attachment.sig>

  parent reply	other threads:[~2010-05-21 13:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21 11:12 [PATCH 1/5] i.MX27: add suspend to RAM support Eric Bénard
2010-05-21 11:12 ` [PATCH 2/5] mxc_nand: fix PM Eric Bénard
2010-05-21 11:12   ` [PATCH 3/5] imx_keypad: add PM support Eric Bénard
2010-05-21 11:12     ` [PATCH 4/5] eukrea_mbimx27: update keyboard platform data Eric Bénard
2010-05-21 11:12       ` [PATCH 5/5] serial/imx.c: fix suspend/resume Eric Bénard
2010-05-21 19:22     ` [PATCH 3/5] imx_keypad: add PM support Russell King - ARM Linux
2010-05-21 11:41   ` [PATCH 2/5] mxc_nand: fix PM Lothar Waßmann
2010-05-21 12:32     ` Eric Bénard
2010-05-21 13:10   ` Wolfram Sang [this message]
2010-05-21 13:22     ` Eric Bénard
2010-05-24 21:10   ` Uwe Kleine-König
2010-05-24 21:16     ` Eric Bénard
2010-05-21 12:02 ` [PATCH 1/5] i.MX27: add suspend to RAM support Lothar Waßmann
2010-05-21 19:19 ` Russell King - ARM Linux

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=20100521131058.GC27829@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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).