From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Lee Jones <lee.jones@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Hans de Goede <hdegoede@redhat.com>,
linux-kernel@vger.kernel.org
Cc: Lee Jones <lee@kernel.org>, Andy Shevchenko <andy@kernel.org>
Subject: [PATCH v3 06/10] mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Date: Mon, 1 Aug 2022 14:42:07 +0300 [thread overview]
Message-ID: <20220801114211.36267-6-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220801114211.36267-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>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
v3: no changes
v2: added tags and rebased on top of new patch 1
drivers/mfd/intel_soc_pmic_crc.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index 082007485cda..d68ed5b35fd9 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -234,7 +234,6 @@ static void intel_soc_pmic_shutdown(struct i2c_client *i2c)
return;
}
-#if defined(CONFIG_PM_SLEEP)
static int intel_soc_pmic_suspend(struct device *dev)
{
struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
@@ -252,10 +251,8 @@ static int intel_soc_pmic_resume(struct device *dev)
return 0;
}
-#endif
-static SIMPLE_DEV_PM_OPS(intel_soc_pmic_pm_ops, intel_soc_pmic_suspend,
- intel_soc_pmic_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(crystal_cove_pm_ops, intel_soc_pmic_suspend, intel_soc_pmic_resume);
static const struct i2c_device_id intel_soc_pmic_i2c_id[] = {
{ }
@@ -273,7 +270,7 @@ MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match);
static struct i2c_driver intel_soc_pmic_i2c_driver = {
.driver = {
.name = "intel_soc_pmic_i2c",
- .pm = &intel_soc_pmic_pm_ops,
+ .pm = pm_sleep_ptr(&crystal_cove_pm_ops),
.acpi_match_table = ACPI_PTR(intel_soc_pmic_acpi_match),
},
.probe = intel_soc_pmic_i2c_probe,
--
2.35.1
next prev parent reply other threads:[~2022-08-01 11:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-01 11:42 [PATCH v3 01/10] mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe() Andy Shevchenko
2022-08-01 11:42 ` [PATCH v3 02/10] mfd: intel_soc_pmic_crc: Merge Intel PMIC core to crc Andy Shevchenko
2022-08-08 16:10 ` Lee Jones
2022-08-01 11:42 ` [PATCH v3 03/10] mfd: intel_soc_pmic: Move non-Intel Makefile entries to their own group Andy Shevchenko
2022-08-08 16:10 ` Lee Jones
2022-08-01 11:42 ` [PATCH v3 04/10] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
2022-08-08 16:12 ` Lee Jones
2022-08-01 11:42 ` [PATCH v3 05/10] mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata() Andy Shevchenko
2022-08-08 16:12 ` Lee Jones
2022-08-01 11:42 ` Andy Shevchenko [this message]
2022-08-08 16:13 ` [PATCH v3 06/10] mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc Lee Jones
2022-08-01 11:42 ` [PATCH v3 07/10] mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery Andy Shevchenko
2022-08-08 16:13 ` Lee Jones
2022-08-01 11:42 ` [PATCH v3 08/10] mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new() Andy Shevchenko
2022-08-08 16:17 ` Lee Jones
2022-08-01 11:42 ` [PATCH v3 09/10] mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove Andy Shevchenko
2022-08-08 16:18 ` Lee Jones
2022-08-01 11:42 ` [PATCH v3 10/10] mfd: intel_soc_pmic_crc: Update the copyright year Andy Shevchenko
2022-08-08 16:18 ` Lee Jones
2022-08-08 16:09 ` [PATCH v3 01/10] mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe() 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=20220801114211.36267-6-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=hdegoede@redhat.com \
--cc=lee.jones@linaro.org \
--cc=lee@kernel.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 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.