diff mbox series

media: i2c: imx290: care CONFIG_PM

Message ID 87edpp1t7j.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show
Series media: i2c: imx290: care CONFIG_PM | expand

Commit Message

Kuninori Morimoto March 15, 2023, 11:38 p.m. UTC
It is using SET_RUNTIME_PM_OPS(), thus we need to care about CONFIG_PM.
Otherwise, we will get below error without it.

${Linux}/drivers/media/i2c/imx290.c:1090:12: error:\
 'imx290_runtime_suspend' defined but not used [-Werror=unused-function]
 1090 | static int imx290_runtime_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~
${Linux}/drivers/media/i2c/imx290.c:1082:12: error: \
 'imx290_runtime_resume' defined but not used [-Werror=unused-function]
 1082 | static int imx290_runtime_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/i2c/imx290.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Laurent Pinchart March 19, 2023, 2:44 p.m. UTC | #1
Hello Morimoto-san,

Thank you for the patch.

On Wed, Mar 15, 2023 at 11:38:08PM +0000, Kuninori Morimoto wrote:
> It is using SET_RUNTIME_PM_OPS(), thus we need to care about CONFIG_PM.
> Otherwise, we will get below error without it.
> 
> ${Linux}/drivers/media/i2c/imx290.c:1090:12: error:\
>  'imx290_runtime_suspend' defined but not used [-Werror=unused-function]
>  1090 | static int imx290_runtime_suspend(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~~
> ${Linux}/drivers/media/i2c/imx290.c:1082:12: error: \
>  'imx290_runtime_resume' defined but not used [-Werror=unused-function]
>  1082 | static int imx290_runtime_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Arnd has sent a patch to fix the same issue already, see
https://lore.kernel.org/linux-media/20230207161316.293923-1-arnd@kernel.org.
It has been merged in the fixes branch of Sakari's tree, I expect it to
hit v6.3 soon.

> ---
>  drivers/media/i2c/imx290.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> index 49d6c8bdec41..5f15b51dfdd3 100644
> --- a/drivers/media/i2c/imx290.c
> +++ b/drivers/media/i2c/imx290.c
> @@ -1079,6 +1079,7 @@ static void imx290_power_off(struct imx290 *imx290)
>  	regulator_bulk_disable(ARRAY_SIZE(imx290->supplies), imx290->supplies);
>  }
>  
> +#ifdef CONFIG_PM
>  static int imx290_runtime_resume(struct device *dev)
>  {
>  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
> @@ -1096,6 +1097,7 @@ static int imx290_runtime_suspend(struct device *dev)
>  
>  	return 0;
>  }
> +#endif
>  
>  static const struct dev_pm_ops imx290_pm_ops = {
>  	SET_RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL)
diff mbox series

Patch

diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
index 49d6c8bdec41..5f15b51dfdd3 100644
--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -1079,6 +1079,7 @@  static void imx290_power_off(struct imx290 *imx290)
 	regulator_bulk_disable(ARRAY_SIZE(imx290->supplies), imx290->supplies);
 }
 
+#ifdef CONFIG_PM
 static int imx290_runtime_resume(struct device *dev)
 {
 	struct v4l2_subdev *sd = dev_get_drvdata(dev);
@@ -1096,6 +1097,7 @@  static int imx290_runtime_suspend(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static const struct dev_pm_ops imx290_pm_ops = {
 	SET_RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL)