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

iio: dac: ds4424: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

Using these newer macros allows the compiler to remove the unused
structure and functions when !CONFIG_PM_SLEEP + removes the need to
mark pm functions __maybe_unused.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Ismail H. Kose <ihkose@gmail.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220621202719.13644-12-jic23@kernel.org

+4 -4
+4 -4
drivers/iio/dac/ds4424.c
··· 171 171 return ret; 172 172 } 173 173 174 - static int __maybe_unused ds4424_suspend(struct device *dev) 174 + static int ds4424_suspend(struct device *dev) 175 175 { 176 176 struct i2c_client *client = to_i2c_client(dev); 177 177 struct iio_dev *indio_dev = i2c_get_clientdata(client); ··· 189 189 return ret; 190 190 } 191 191 192 - static int __maybe_unused ds4424_resume(struct device *dev) 192 + static int ds4424_resume(struct device *dev) 193 193 { 194 194 struct i2c_client *client = to_i2c_client(dev); 195 195 struct iio_dev *indio_dev = i2c_get_clientdata(client); ··· 206 206 return ret; 207 207 } 208 208 209 - static SIMPLE_DEV_PM_OPS(ds4424_pm_ops, ds4424_suspend, ds4424_resume); 209 + static DEFINE_SIMPLE_DEV_PM_OPS(ds4424_pm_ops, ds4424_suspend, ds4424_resume); 210 210 211 211 static const struct iio_info ds4424_info = { 212 212 .read_raw = ds4424_read_raw, ··· 312 312 .driver = { 313 313 .name = "ds4424", 314 314 .of_match_table = ds4424_of_match, 315 - .pm = &ds4424_pm_ops, 315 + .pm = pm_sleep_ptr(&ds4424_pm_ops), 316 316 }, 317 317 .probe = ds4424_probe, 318 318 .remove = ds4424_remove,