summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-06-29 00:17:42 +0200
committerLee Jones <lee@kernel.org>2022-07-19 11:54:42 +0200
commit05879b125afd274020faf2bb8c57e9304073ac31 (patch)
tree4cd9542b99959222dfcb6aabff54c6bd216c9174 /drivers/mfd
parentmfd: intel_soc_pmic_bxtwc: Extend use of temporary variable for struct device (diff)
downloadlinux-05879b125afd274020faf2bb8c57e9304073ac31.tar.xz
linux-05879b125afd274020faf2bb8c57e9304073ac31.zip
mfd: intel_soc_pmic_bxtwc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
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> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-6-andriy.shevchenko@linux.intel.com
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/intel_soc_pmic_bxtwc.c7
1 files 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,
},