public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andy@kernel.org>, Lee Jones <lee.jones@linaro.org>
Subject: [PATCH v2 06/11] mfd: intel_soc_pmic_bxtwc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Date: Wed, 29 Jun 2022 01:17:42 +0300	[thread overview]
Message-ID: <20220628221747.33956-6-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220628221747.33956-1-andriy.shevchenko@linux.intel.com>

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based kernel configuration guards.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
v2: added tag (Lee)

 drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index bcecb3d75d5a..7c3ce440c826 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -542,7 +542,6 @@ static void bxtwc_shutdown(struct platform_device *pdev)
 	disable_irq(pmic->irq);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int bxtwc_suspend(struct device *dev)
 {
 	struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
@@ -559,8 +558,8 @@ static int bxtwc_resume(struct device *dev)
 	enable_irq(pmic->irq);
 	return 0;
 }
-#endif
-static SIMPLE_DEV_PM_OPS(bxtwc_pm_ops, bxtwc_suspend, bxtwc_resume);
+
+static DEFINE_SIMPLE_DEV_PM_OPS(bxtwc_pm_ops, bxtwc_suspend, bxtwc_resume);
 
 static const struct acpi_device_id bxtwc_acpi_ids[] = {
 	{ "INT34D3", },
@@ -573,7 +572,7 @@ static struct platform_driver bxtwc_driver = {
 	.shutdown = bxtwc_shutdown,
 	.driver	= {
 		.name	= "BXTWC PMIC",
-		.pm     = &bxtwc_pm_ops,
+		.pm     = pm_sleep_ptr(&bxtwc_pm_ops),
 		.acpi_match_table = ACPI_PTR(bxtwc_acpi_ids),
 		.dev_groups = bxtwc_groups,
 	},
-- 
2.35.1


  parent reply	other threads:[~2022-06-28 22:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 22:17 [PATCH v2 01/11] mfd: intel_soc_pmic_bxtwc: Don't shadow error codes in show()/store() Andy Shevchenko
2022-06-28 22:17 ` [PATCH v2 02/11] mfd: intel_soc_pmic_bxtwc: Create sysfs attributes using core driver's facility Andy Shevchenko
2022-07-11  8:16   ` Lee Jones
2022-06-28 22:17 ` [PATCH v2 03/11] mfd: intel_soc_pmic_bxtwc: Convert to use platform_get/set_drvdata() Andy Shevchenko
2022-07-11  8:28   ` Lee Jones
2022-06-28 22:17 ` [PATCH v2 04/11] mfd: intel_soc_pmic_bxtwc: Use dev_err_probe() Andy Shevchenko
2022-07-11  8:29   ` Lee Jones
2022-06-28 22:17 ` [PATCH v2 05/11] mfd: intel_soc_pmic_bxtwc: Extend use of temporary variable for struct device Andy Shevchenko
2022-07-11  8:32   ` Lee Jones
2022-06-28 22:17 ` Andy Shevchenko [this message]
2022-07-11  8:36   ` [PATCH v2 06/11] mfd: intel_soc_pmic_bxtwc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc Lee Jones
2022-06-28 22:17 ` [PATCH v2 07/11] mfd: intel_soc_pmic_bxtwc: Drop redundant ACPI_PTR() Andy Shevchenko
2022-07-11  8:37   ` Lee Jones
2022-06-28 22:17 ` [PATCH v2 08/11] mfd: intel_soc_pmic_bxtwc: Use bits.h macros for all masks Andy Shevchenko
2022-07-11  8:37   ` Lee Jones
2022-06-28 22:17 ` [PATCH v2 09/11] mfd: intel_soc_pmic_bxtwc: Use sysfs_emit() instead of sprintf() Andy Shevchenko
2022-07-11  8:37   ` Lee Jones
2022-06-28 22:17 ` [PATCH v2 10/11] mfd: intel_soc_pmic_bxtwc: Drop unneeded casting Andy Shevchenko
2022-07-11  8:38   ` Lee Jones
2022-06-28 22:17 ` [PATCH v2 11/11] mfd: intel_soc_pmic_bxtwc: Fix spelling in the comment Andy Shevchenko
2022-07-11  8:38   ` Lee Jones
2022-07-11  8:15 ` [PATCH v2 01/11] mfd: intel_soc_pmic_bxtwc: Don't shadow error codes in show()/store() Lee Jones

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=20220628221747.33956-6-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.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