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

rtc: tegra: Replace deprecated SIMPLE_DEV_PM_OPS

Replace deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS macro
and use pm_sleep_ptr() to initialize pm_ops. This also allows us to drop
the checks for CONFIG_PM_SLEEP.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20251024064952.775883-3-kkartik@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Kartik Rajput and committed by
Alexandre Belloni
bf5ef3ce 0a293451

+2 -4
+2 -4
drivers/rtc/rtc-tegra.c
··· 340 340 return 0; 341 341 } 342 342 343 - #ifdef CONFIG_PM_SLEEP 344 343 static int tegra_rtc_suspend(struct device *dev) 345 344 { 346 345 struct tegra_rtc_info *info = dev_get_drvdata(dev); ··· 377 378 378 379 return 0; 379 380 } 380 - #endif 381 381 382 - static SIMPLE_DEV_PM_OPS(tegra_rtc_pm_ops, tegra_rtc_suspend, tegra_rtc_resume); 382 + static DEFINE_SIMPLE_DEV_PM_OPS(tegra_rtc_pm_ops, tegra_rtc_suspend, tegra_rtc_resume); 383 383 384 384 static void tegra_rtc_shutdown(struct platform_device *pdev) 385 385 { ··· 393 395 .name = "tegra_rtc", 394 396 .of_match_table = tegra_rtc_dt_match, 395 397 .acpi_match_table = tegra_rtc_acpi_match, 396 - .pm = &tegra_rtc_pm_ops, 398 + .pm = pm_sleep_ptr(&tegra_rtc_pm_ops), 397 399 }, 398 400 }; 399 401 module_platform_driver(tegra_rtc_driver);