mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-22 10:04:25 -05:00
media: imx-mipi-csis: Switch to RUNTIME_PM_OPS()
Replace SET_RUNTIME_PM_OPS() with its modern RUNTIME_PM_OPS() alternative. The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20240807182610.81244-1-festevam@gmail.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
3f6a2f8768
commit
4e3972533f
@@ -1347,7 +1347,7 @@ static int mipi_csis_async_register(struct mipi_csis_device *csis)
|
||||
* Suspend/resume
|
||||
*/
|
||||
|
||||
static int __maybe_unused mipi_csis_runtime_suspend(struct device *dev)
|
||||
static int mipi_csis_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct v4l2_subdev *sd = dev_get_drvdata(dev);
|
||||
struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd);
|
||||
@@ -1362,7 +1362,7 @@ static int __maybe_unused mipi_csis_runtime_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused mipi_csis_runtime_resume(struct device *dev)
|
||||
static int mipi_csis_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct v4l2_subdev *sd = dev_get_drvdata(dev);
|
||||
struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd);
|
||||
@@ -1382,8 +1382,8 @@ static int __maybe_unused mipi_csis_runtime_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops mipi_csis_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(mipi_csis_runtime_suspend, mipi_csis_runtime_resume,
|
||||
NULL)
|
||||
RUNTIME_PM_OPS(mipi_csis_runtime_suspend, mipi_csis_runtime_resume,
|
||||
NULL)
|
||||
};
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
@@ -1574,7 +1574,7 @@ static struct platform_driver mipi_csis_driver = {
|
||||
.driver = {
|
||||
.of_match_table = mipi_csis_of_match,
|
||||
.name = CSIS_DRIVER_NAME,
|
||||
.pm = &mipi_csis_pm_ops,
|
||||
.pm = pm_ptr(&mipi_csis_pm_ops),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user