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

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: rzg2l_adc: Switch to RUNTIME_PM_OPS() and pm_ptr()

The use of SET_RUNTIME_PM_OPS() is now deprecated and requires
__maybe_unused annotations to avoid warnings about unused functions.
Switching to RUNTIME_PM_OPS() and pm_ptr() eliminates the need for such
annotations because the compiler can directly reference the runtime PM
functions, thereby suppressing the warnings. As a result, the
__maybe_unused markings can be removed.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20241206111337.726244-6-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Claudiu Beznea and committed by
Jonathan Cameron
7842ef74 89ee8174

+4 -6
+4 -6
drivers/iio/adc/rzg2l_adc.c
··· 456 456 }; 457 457 MODULE_DEVICE_TABLE(of, rzg2l_adc_match); 458 458 459 - static int __maybe_unused rzg2l_adc_pm_runtime_suspend(struct device *dev) 459 + static int rzg2l_adc_pm_runtime_suspend(struct device *dev) 460 460 { 461 461 struct iio_dev *indio_dev = dev_get_drvdata(dev); 462 462 struct rzg2l_adc *adc = iio_priv(indio_dev); ··· 466 466 return 0; 467 467 } 468 468 469 - static int __maybe_unused rzg2l_adc_pm_runtime_resume(struct device *dev) 469 + static int rzg2l_adc_pm_runtime_resume(struct device *dev) 470 470 { 471 471 struct iio_dev *indio_dev = dev_get_drvdata(dev); 472 472 struct rzg2l_adc *adc = iio_priv(indio_dev); ··· 477 477 } 478 478 479 479 static const struct dev_pm_ops rzg2l_adc_pm_ops = { 480 - SET_RUNTIME_PM_OPS(rzg2l_adc_pm_runtime_suspend, 481 - rzg2l_adc_pm_runtime_resume, 482 - NULL) 480 + RUNTIME_PM_OPS(rzg2l_adc_pm_runtime_suspend, rzg2l_adc_pm_runtime_resume, NULL) 483 481 }; 484 482 485 483 static struct platform_driver rzg2l_adc_driver = { ··· 485 487 .driver = { 486 488 .name = DRIVER_NAME, 487 489 .of_match_table = rzg2l_adc_match, 488 - .pm = &rzg2l_adc_pm_ops, 490 + .pm = pm_ptr(&rzg2l_adc_pm_ops), 489 491 }, 490 492 }; 491 493