Skip to content

Commit 7b50567

Browse files
arndbtorvalds
authored andcommitted
media: i2c: imx290: fix conditional function defintions
The runtime suspend/resume functions are only referenced from the dev_pm_ops, but they use the old SET_RUNTIME_PM_OPS() helper that requires a __maybe_unused annotation to avoid a warning: drivers/media/i2c/imx290.c:1082:12: error: unused function 'imx290_runtime_resume' [-Werror,-Wunused-function] static int imx290_runtime_resume(struct device *dev) ^ drivers/media/i2c/imx290.c:1090:12: error: unused function 'imx290_runtime_suspend' [-Werror,-Wunused-function] static int imx290_runtime_suspend(struct device *dev) ^ Convert this to the new RUNTIME_PM_OPS() helper that so this is not required. To improve this further, also use the pm_ptr() helper that lets the dev_pm_ops get dropped entirely when CONFIG_PM is disabled. A related mistake happened in the of_match_ptr() macro here, which like SET_RUNTIME_PM_OPS() requires the match table to be marked as __maybe_unused, though I could not reproduce building this without CONFIG_OF. Remove the of_match_ptr() here as there is no point in dropping the match table in configurations without CONFIG_OF. Fixes: 02852c0 ("media: i2c: imx290: Initialize runtime PM before subdev") Signed-off-by: Arnd Bergmann <[email protected]> Reported-by: Guenter Roeck <[email protected]> Reported-by: Sudip Mukherjee <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a0264d1 commit 7b50567

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/media/i2c/imx290.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ static int imx290_runtime_suspend(struct device *dev)
10981098
}
10991099

11001100
static const struct dev_pm_ops imx290_pm_ops = {
1101-
SET_RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL)
1101+
RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL)
11021102
};
11031103

11041104
/* ----------------------------------------------------------------------------
@@ -1362,8 +1362,8 @@ static struct i2c_driver imx290_i2c_driver = {
13621362
.remove = imx290_remove,
13631363
.driver = {
13641364
.name = "imx290",
1365-
.pm = &imx290_pm_ops,
1366-
.of_match_table = of_match_ptr(imx290_of_match),
1365+
.pm = pm_ptr(&imx290_pm_ops),
1366+
.of_match_table = imx290_of_match,
13671367
},
13681368
};
13691369

0 commit comments

Comments
 (0)