Skip to content

Commit 05879b1

Browse files
andy-shevlag-linaro
authored andcommitted
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 <[email protected]> Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ba3ea04 commit 05879b1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/mfd/intel_soc_pmic_bxtwc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ static void bxtwc_shutdown(struct platform_device *pdev)
542542
disable_irq(pmic->irq);
543543
}
544544

545-
#ifdef CONFIG_PM_SLEEP
546545
static int bxtwc_suspend(struct device *dev)
547546
{
548547
struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
@@ -559,8 +558,8 @@ static int bxtwc_resume(struct device *dev)
559558
enable_irq(pmic->irq);
560559
return 0;
561560
}
562-
#endif
563-
static SIMPLE_DEV_PM_OPS(bxtwc_pm_ops, bxtwc_suspend, bxtwc_resume);
561+
562+
static DEFINE_SIMPLE_DEV_PM_OPS(bxtwc_pm_ops, bxtwc_suspend, bxtwc_resume);
564563

565564
static const struct acpi_device_id bxtwc_acpi_ids[] = {
566565
{ "INT34D3", },
@@ -573,7 +572,7 @@ static struct platform_driver bxtwc_driver = {
573572
.shutdown = bxtwc_shutdown,
574573
.driver = {
575574
.name = "BXTWC PMIC",
576-
.pm = &bxtwc_pm_ops,
575+
.pm = pm_sleep_ptr(&bxtwc_pm_ops),
577576
.acpi_match_table = ACPI_PTR(bxtwc_acpi_ids),
578577
.dev_groups = bxtwc_groups,
579578
},

0 commit comments

Comments
 (0)