media: i2c: imx290: make suspend/resume functions __maybe_unused

Message ID 20230208211914.7625-1-rdunlap@infradead.org
State New
Headers
Series media: i2c: imx290: make suspend/resume functions __maybe_unused |

Commit Message

Randy Dunlap Feb. 8, 2023, 9:19 p.m. UTC
  GCC reports that these 2 functions are defined but not used, so mark
them as __maybe_unused to pacify the build.

drivers/media/i2c/imx290.c:1090:12: warning: 'imx290_runtime_suspend' defined but not used [-Wunused-function]
 1090 | static int imx290_runtime_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/imx290.c:1082:12: warning: 'imx290_runtime_resume' defined but not used [-Wunused-function]
 1082 | static int imx290_runtime_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~

Fixes: 02852c01f654 ("media: i2c: imx290: Initialize runtime PM before subdev")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/media/i2c/imx290.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Laurent Pinchart Feb. 9, 2023, 9:08 a.m. UTC | #1
Hi Randy,

Thank you for the patch.

On Wed, Feb 08, 2023 at 01:19:14PM -0800, Randy Dunlap wrote:
> GCC reports that these 2 functions are defined but not used, so mark
> them as __maybe_unused to pacify the build.
> 
> drivers/media/i2c/imx290.c:1090:12: warning: 'imx290_runtime_suspend' defined but not used [-Wunused-function]
>  1090 | static int imx290_runtime_suspend(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~~
> drivers/media/i2c/imx290.c:1082:12: warning: 'imx290_runtime_resume' defined but not used [-Wunused-function]
>  1082 | static int imx290_runtime_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~

Arnd has sent another fix for this, see [1].

[1] https://lore.kernel.org/linux-media/20230207161316.293923-1-arnd@kernel.org/

> Fixes: 02852c01f654 ("media: i2c: imx290: Initialize runtime PM before subdev")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>  drivers/media/i2c/imx290.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -- a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> --- a/drivers/media/i2c/imx290.c
> +++ b/drivers/media/i2c/imx290.c
> @@ -1079,7 +1079,7 @@ static void imx290_power_off(struct imx2
>  	regulator_bulk_disable(ARRAY_SIZE(imx290->supplies), imx290->supplies);
>  }
>  
> -static int imx290_runtime_resume(struct device *dev)
> +static int __maybe_unused imx290_runtime_resume(struct device *dev)
>  {
>  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
>  	struct imx290 *imx290 = to_imx290(sd);
> @@ -1087,7 +1087,7 @@ static int imx290_runtime_resume(struct
>  	return imx290_power_on(imx290);
>  }
>  
> -static int imx290_runtime_suspend(struct device *dev)
> +static int __maybe_unused imx290_runtime_suspend(struct device *dev)
>  {
>  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
>  	struct imx290 *imx290 = to_imx290(sd);
  

Patch

diff -- a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -1079,7 +1079,7 @@  static void imx290_power_off(struct imx2
 	regulator_bulk_disable(ARRAY_SIZE(imx290->supplies), imx290->supplies);
 }
 
-static int imx290_runtime_resume(struct device *dev)
+static int __maybe_unused imx290_runtime_resume(struct device *dev)
 {
 	struct v4l2_subdev *sd = dev_get_drvdata(dev);
 	struct imx290 *imx290 = to_imx290(sd);
@@ -1087,7 +1087,7 @@  static int imx290_runtime_resume(struct
 	return imx290_power_on(imx290);
 }
 
-static int imx290_runtime_suspend(struct device *dev)
+static int __maybe_unused imx290_runtime_suspend(struct device *dev)
 {
 	struct v4l2_subdev *sd = dev_get_drvdata(dev);
 	struct imx290 *imx290 = to_imx290(sd);