From: Adrian Hunter <adrian.hunter@intel.com>
To: Vinayak Holikatti <vinholikatti@gmail.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Christoph Hellwig <hch@infradead.org>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
Subhash Jadavani <subhashj@codeaurora.org>,
Santosh Yaragnavi <santosh.sy@samsung.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Szymon Mielczarek <szymonx.mielczarek@intel.com>,
Michal Potomski <michalx.potomski@intel.com>,
Grzegorz Janca <grzegorz.janca@intel.com>
Subject: [PATCH V4 1/2] scsi: ufshcd-pci: Fix PM config
Date: Tue, 6 Jun 2017 14:35:30 +0300 [thread overview]
Message-ID: <1496748931-17162-2-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1496748931-17162-1-git-send-email-adrian.hunter@intel.com>
Put PM functions under correct config options and use standard PM macros
to set callbacks.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/scsi/ufs/ufshcd-pci.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd-pci.c b/drivers/scsi/ufs/ufshcd-pci.c
index 5dd4122cbd85..0dcff829f8b6 100644
--- a/drivers/scsi/ufs/ufshcd-pci.c
+++ b/drivers/scsi/ufs/ufshcd-pci.c
@@ -37,7 +37,7 @@
#include <linux/pci.h>
#include <linux/pm_runtime.h>
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
/**
* ufshcd_pci_suspend - suspend power management function
* @pdev: pointer to PCI device handle
@@ -62,7 +62,9 @@ static int ufshcd_pci_resume(struct device *dev)
{
return ufshcd_system_resume(dev_get_drvdata(dev));
}
+#endif /* !CONFIG_PM_SLEEP */
+#ifdef CONFIG_PM
static int ufshcd_pci_runtime_suspend(struct device *dev)
{
return ufshcd_runtime_suspend(dev_get_drvdata(dev));
@@ -75,13 +77,7 @@ static int ufshcd_pci_runtime_idle(struct device *dev)
{
return ufshcd_runtime_idle(dev_get_drvdata(dev));
}
-#else /* !CONFIG_PM */
-#define ufshcd_pci_suspend NULL
-#define ufshcd_pci_resume NULL
-#define ufshcd_pci_runtime_suspend NULL
-#define ufshcd_pci_runtime_resume NULL
-#define ufshcd_pci_runtime_idle NULL
-#endif /* CONFIG_PM */
+#endif /* !CONFIG_PM */
/**
* ufshcd_pci_shutdown - main function to put the controller in reset state
@@ -158,11 +154,11 @@ static void ufshcd_pci_remove(struct pci_dev *pdev)
}
static const struct dev_pm_ops ufshcd_pci_pm_ops = {
- .suspend = ufshcd_pci_suspend,
- .resume = ufshcd_pci_resume,
- .runtime_suspend = ufshcd_pci_runtime_suspend,
- .runtime_resume = ufshcd_pci_runtime_resume,
- .runtime_idle = ufshcd_pci_runtime_idle,
+ SET_SYSTEM_SLEEP_PM_OPS(ufshcd_pci_suspend,
+ ufshcd_pci_resume)
+ SET_RUNTIME_PM_OPS(ufshcd_pci_runtime_suspend,
+ ufshcd_pci_runtime_resume,
+ ufshcd_pci_runtime_idle)
};
static const struct pci_device_id ufshcd_pci_tbl[] = {
--
1.9.1
next prev parent reply other threads:[~2017-06-06 11:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-06 11:35 [PATCH V4 0/2] scsi: ufshcd-pci: Add Intel CNL support Adrian Hunter
2017-06-06 11:35 ` Adrian Hunter [this message]
2017-06-07 13:14 ` [PATCH V4 1/2] scsi: ufshcd-pci: Fix PM config Christoph Hellwig
2017-06-06 11:35 ` [PATCH V4 2/2] scsi: ufshcd-pci: Add Intel CNL support Adrian Hunter
2017-06-07 13:16 ` Christoph Hellwig
2017-06-08 9:36 ` Joao Pinto
2017-06-08 9:36 ` Joao Pinto
2017-06-13 1:08 ` [PATCH V4 0/2] " Martin K. Petersen
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=1496748931-17162-2-git-send-email-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--cc=grzegorz.janca@intel.com \
--cc=hch@infradead.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michalx.potomski@intel.com \
--cc=santosh.sy@samsung.com \
--cc=subhashj@codeaurora.org \
--cc=szymonx.mielczarek@intel.com \
--cc=vinholikatti@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.