Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: intel_soc_pmic_chtwc: Switch from __maybe_unused 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 heavier for builds
than the use of __maybe_unused attributes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220616171009.43524-2-andriy.shevchenko@linux.intel.com

authored by

Andy Shevchenko and committed by
Lee Jones
1074c425 352de780

+4 -4
+4 -4
drivers/mfd/intel_soc_pmic_chtwc.c
··· 222 222 disable_irq(pmic->irq); 223 223 } 224 224 225 - static int __maybe_unused cht_wc_suspend(struct device *dev) 225 + static int cht_wc_suspend(struct device *dev) 226 226 { 227 227 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); 228 228 ··· 231 231 return 0; 232 232 } 233 233 234 - static int __maybe_unused cht_wc_resume(struct device *dev) 234 + static int cht_wc_resume(struct device *dev) 235 235 { 236 236 struct intel_soc_pmic *pmic = dev_get_drvdata(dev); 237 237 ··· 239 239 240 240 return 0; 241 241 } 242 - static SIMPLE_DEV_PM_OPS(cht_wc_pm_ops, cht_wc_suspend, cht_wc_resume); 242 + static DEFINE_SIMPLE_DEV_PM_OPS(cht_wc_pm_ops, cht_wc_suspend, cht_wc_resume); 243 243 244 244 static const struct i2c_device_id cht_wc_i2c_id[] = { 245 245 { } ··· 253 253 static struct i2c_driver cht_wc_driver = { 254 254 .driver = { 255 255 .name = "CHT Whiskey Cove PMIC", 256 - .pm = &cht_wc_pm_ops, 256 + .pm = pm_sleep_ptr(&cht_wc_pm_ops), 257 257 .acpi_match_table = cht_wc_acpi_ids, 258 258 }, 259 259 .probe_new = cht_wc_probe,