linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <shuah.kh@samsung.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	mirq-linux@rere.qmqm.pl, Chris Ball <chris@printf.net>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Shuah Khan <shuahkhan@gmail.com>,
	Shuah Khan <shuah.kh@samsung.com>
Subject: Re: [RFT][PATCH v3] mmc: change cb710-mmc platform power management to use dev_pm_ops
Date: Thu, 13 Feb 2014 06:49:33 -0700	[thread overview]
Message-ID: <52FCCD6D.6020704@samsung.com> (raw)
In-Reply-To: <CAPDyKFoukY2PGNWimUbRqDr36eJ_+eBASJR4uac6nH4-kowmCQ@mail.gmail.com>

On 02/13/2014 02:47 AM, Ulf Hansson wrote:
> On 12 February 2014 22:21, Shuah Khan <shuah.kh@samsung.com> wrote:
>> Change cb710-mmc platform driver to register pm ops using dev_pm_ops instead
>> of legacy pm_ops. The existing legacy suspend/resume routines are identical
>> and simply clear IRQ mask in the device in case it got undefined during sleep
>> state. Changed code to collapse suspend and resume into one .pm interface
>> for suspend and resume which gets installed for suspend, freeze, poweroff,
>> thaw, restore, and resume states using SIMPLE_DEV_PM_OPS().
>>
>> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
>> ---
>>
>> patch v3: Addresses review comments on patch v2
>>
>>   drivers/mmc/host/cb710-mmc.c |   40 ++++++++++++++++------------------------
>>   1 file changed, 16 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
>> index 1087b4c..2dc7b2dc 100644
>> --- a/drivers/mmc/host/cb710-mmc.c
>> +++ b/drivers/mmc/host/cb710-mmc.c
>> @@ -662,26 +662,6 @@ static const struct mmc_host_ops cb710_mmc_host = {
>>          .get_cd = cb710_mmc_get_cd,
>>   };
>>
>> -#ifdef CONFIG_PM
>> -
>> -static int cb710_mmc_suspend(struct platform_device *pdev, pm_message_t state)
>> -{
>> -       struct cb710_slot *slot = cb710_pdev_to_slot(pdev);
>> -
>> -       cb710_mmc_enable_irq(slot, 0, ~0);
>> -       return 0;
>> -}
>> -
>> -static int cb710_mmc_resume(struct platform_device *pdev)
>> -{
>> -       struct cb710_slot *slot = cb710_pdev_to_slot(pdev);
>> -
>> -       cb710_mmc_enable_irq(slot, 0, ~0);
>> -       return 0;
>> -}
>> -
>> -#endif /* CONFIG_PM */
>> -
>>   static int cb710_mmc_init(struct platform_device *pdev)
>>   {
>>          struct cb710_slot *slot = cb710_pdev_to_slot(pdev);
>> @@ -762,14 +742,26 @@ static int cb710_mmc_exit(struct platform_device *pdev)
>>          return 0;
>>   }
>>
>> +#ifdef CONFIG_PM_SLEEP
>> +static int cb710_mmc_suspend_resume(struct device *dev)
>> +{
>> +       struct cb710_slot *slot = cb710_pdev_to_slot(to_platform_device(dev));
>> +
>> +       cb710_mmc_enable_irq(slot, 0, ~0);
>> +       return 0;
>> +}
>> +#else
>> +#define cb710_mmc_suspend_resume NULL
>
> You don't need this. The macro will handle this for you.
>

Without this compiles fail when CONFIG_PM_SLEEP is not defined.

-- Shuah


-- 
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658

  reply	other threads:[~2014-02-13 13:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 21:21 [RFT][PATCH v3] mmc: change cb710-mmc platform power management to use dev_pm_ops Shuah Khan
2014-02-13  9:47 ` Ulf Hansson
2014-02-13 13:49   ` Shuah Khan [this message]
2014-02-14 14:32     ` Ulf Hansson

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=52FCCD6D.6020704@samsung.com \
    --to=shuah.kh@samsung.com \
    --cc=chris@printf.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=rjw@rjwysocki.net \
    --cc=shuahkhan@gmail.com \
    --cc=ulf.hansson@linaro.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).