linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frans Pop <elendil@planet.nl>
To: Manuel Lauss <manuel.lauss@googlemail.com>
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
	manuel.lauss@gmail.com
Subject: Re: [PATCH] au1xmmc: dev_pm_ops conversion
Date: Mon, 20 Jul 2009 22:00:37 +0200	[thread overview]
Message-ID: <200907202200.39288.elendil@planet.nl> (raw)
In-Reply-To: <1248115882-20221-1-git-send-email-manuel.lauss@gmail.com>

> Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
> ---
> Run-tested on Au1200.
>
>  drivers/mmc/host/au1xmmc.c |   23 +++++++++++------------
>  1 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
> index d3f5561..70509c9 100644
> --- a/drivers/mmc/host/au1xmmc.c
> +++ b/drivers/mmc/host/au1xmmc.c
> @@ -1131,13 +1131,12 @@ static int __devexit au1xmmc_remove(struct
> platform_device *pdev) return 0;
>  }
>  
> -#ifdef CONFIG_PM

Won't the removal of this test cause a build failure if CONFIG_PM is not 
set? If the removal of the test is safe, this should IMHO at least be 
explained in the commit message.

The IMO simplest fix would be to restore the #ifdef ...

> -static int au1xmmc_suspend(struct platform_device *pdev, pm_message_t
> state) +static int au1xmmc_suspend(struct device *dev)
>  {
> -       struct au1xmmc_host *host = platform_get_drvdata(pdev);
> +       struct au1xmmc_host *host = dev_get_drvdata(dev);
>         int ret;
>  
> -       ret = mmc_suspend_host(host->mmc, state);
> +       ret = mmc_suspend_host(host->mmc, PMSG_SUSPEND);
>         if (ret)
>                 return ret;
>  
> @@ -1150,27 +1149,27 @@ static int au1xmmc_suspend(struct
> platform_device *pdev, pm_message_t state) return 0;
>  }
>  
> -static int au1xmmc_resume(struct platform_device *pdev)
> +static int au1xmmc_resume(struct device *dev)
>  {
> -       struct au1xmmc_host *host = platform_get_drvdata(pdev);
> +       struct au1xmmc_host *host = dev_get_drvdata(dev);
>  
>         au1xmmc_reset_controller(host);
>  
>         return mmc_resume_host(host->mmc);
>  }
> -#else
> -#define au1xmmc_suspend NULL
> -#define au1xmmc_resume NULL

... drop the 3 lines above (as you did) ...

> -#endif

... move this #endif to after the new struct below ...

> +
> +static struct dev_pm_ops au1xmmc_pmops = {
> +       .resume         = au1xmmc_resume,
> +       .suspend        = au1xmmc_suspend,
> +};
>  
>  static struct platform_driver au1xmmc_driver = {
>         .probe         = au1xmmc_probe,
>         .remove        = au1xmmc_remove,
> -       .suspend       = au1xmmc_suspend,
> -       .resume        = au1xmmc_resume,
>         .driver        = {
>                 .name  = DRIVER_NAME,
>                 .owner = THIS_MODULE,
> +               .pm    = &au1xmmc_pmops,

... and add an #ifdef CONFIG_PM around the new line above.

>         },
>  };

Cheers,
FJP

  parent reply	other threads:[~2009-07-20 20:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-20 18:51 [PATCH] au1xmmc: dev_pm_ops conversion Manuel Lauss
2009-07-20 18:51 ` [PATCH] au1xmmc: allow platforms to disable certain host capabilities Manuel Lauss
2009-07-20 20:00 ` Frans Pop [this message]
2009-07-21  5:12   ` [PATCH] au1xmmc: dev_pm_ops conversion Manuel Lauss
2009-07-21 14:48     ` Frans Pop

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=200907202200.39288.elendil@planet.nl \
    --to=elendil@planet.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=manuel.lauss@gmail.com \
    --cc=manuel.lauss@googlemail.com \
    /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).