public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Peter Hüwe" <PeterHuewe@gmx.de>
To: Shuah Khan <shuah.kh@samsung.com>
Cc: "tpmdd-devel@lists.sourceforge.net" 
	<tpmdd-devel@lists.sourceforge.net>,
	"rafael.j.wysocki@intel.com" <rafael.j.wysocki@intel.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"a.zummo@towertech.it" <a.zummo@towertech.it>,
	"key@linux.vnet.ibm.com" <key@linux.vnet.ibm.com>,
	"mail@srajiv.net" <mail@srajiv.net>,
	"tpmdd@selhorst.net" <tpmdd@selhorst.net>,
	"tpmdd@sirrix.com" <tpmdd@sirrix.com>,
	"matthew.garrett@nebula.com" <matthew.garrett@nebula.com>,
	"rtc-linux@googlegroups.com" <rtc-linux@googlegroups.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"platform-driver-x86@vger.kernel.org" 
	<platform-driver-x86@vger.kernel.org>,
	"shuahkhan@gmail.com" <shuahkhan@gmail.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [tpmdd-devel] [PATCH 3/4] tpm: Convert tpm_tis driver to use dev_pm_ops from legacy pm_ops
Date: Thu, 11 Jul 2013 01:37:32 +0200	[thread overview]
Message-ID: <201307110137.32309.PeterHuewe@gmx.de> (raw)
In-Reply-To: <B8EFE96D1287C24090BAD9D858E15E61738933@sisaex02sj>

Hi Shuah,
thanks for your reply.


> >> +#ifdef CONFIG_PM_SLEEP
> >> +	.driver	= {
> >> +		.pm = &tpm_tis_pm,
> >> +	},
> >> +#endif
> >> 
> >>   };
> > 
> > I don't think the #if CONFIG_PM_SLEEP is required here.
In this case, the SIMPLE_DEV_PM_OPS macro handles the case internally - i.e. 
no matter whether CONFIG_PM_SLEEP is set or not, the correct structure is set 
up and thus no ifdef needed.


> 
> tpm_tis_resume() is defined originally in CONFIG_PM_SLEEP scope. I can
> make the change to have tpm_tis_resume() not be in CONFIG_PM_SLEEP scope
> and remove this CONFIG_PM_SLEEP when defining .pm. 
> That does make sense looking at tpm_pm_suspend() and tpm_pm_resume() which  
> are defined ithout CONFIG_PM_SLEEP scope. Sounds like the right approach?
> I will redo the patch and send v2.

Hmm,
at first I thought that would be a good idea, however scrolling to the git 
history I found:

commit 07368d32f1a67e797def08cf2ee3ea1647b204b6
Author: Rafael J. Wysocki <rjw@sisk.pl>
Date:   Thu Aug 9 23:00:35 2012 +0200

    tpm_tis / PM: Fix unused function warning for CONFIG_PM_SLEEP
    
    According to a compiler warning, the tpm_tis_resume() function is not
    used for CONFIG_PM_SLEEP unset, so add a #ifdef to prevent it from
    being built in that case.
    
    Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

So removing it there would effectively revert the patch and re-enable the 
warning.


 
> I find that the use of CONFIG_PM, CONFIG_PM_SLEEP, and CONFIG_PM_RUNTIME
> are not very consistent. :)
Yes.

Maybe the better idea is to add the correct CONFIG_PM ifdefs for all code 
paths related to PM.
Or leave the CONFIG_PM for tpm_tis_resume as it is.


Thanks,
Peter

  reply	other threads:[~2013-07-10 23:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10  4:10 [PATCH 3/4] tpm: Convert tpm_tis driver to use dev_pm_ops from legacy pm_ops Shuah Khan
2013-07-10 22:51 ` [tpmdd-devel] " Peter Hüwe
2013-07-10 23:02   ` Shuah Khan
2013-07-10 23:37     ` Peter Hüwe [this message]
2013-07-11  1:30       ` Shuah Khan

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=201307110137.32309.PeterHuewe@gmx.de \
    --to=peterhuewe@gmx.de \
    --cc=a.zummo@towertech.it \
    --cc=bhelgaas@google.com \
    --cc=key@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@srajiv.net \
    --cc=matthew.garrett@nebula.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@sisk.pl \
    --cc=rtc-linux@googlegroups.com \
    --cc=shuah.kh@samsung.com \
    --cc=shuahkhan@gmail.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    --cc=tpmdd@sirrix.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