2021-10-13 01:49:37

by Cai,Huoqing

[permalink] [raw]
Subject: [PATCH] iio: imx8qxp-adc: Fix the error - defined but not used for runtime pm API

Add the prefix '__maybe_unused' to imx8qxp_adc_runtime_suspend/resume()
to avoid the compiler complain without setting CONFIG_SUSPEND,
CONFIG_HIBERNATION and CONFIG_PM.

Signed-off-by: Cai Huoqing <[email protected]>
---
drivers/iio/adc/imx8qxp-adc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/imx8qxp-adc.c b/drivers/iio/adc/imx8qxp-adc.c
index 5030e0d8318d..011bef4b5dda 100644
--- a/drivers/iio/adc/imx8qxp-adc.c
+++ b/drivers/iio/adc/imx8qxp-adc.c
@@ -416,7 +416,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)
return 0;
}

-static int imx8qxp_adc_runtime_suspend(struct device *dev)
+static int __maybe_unused imx8qxp_adc_runtime_suspend(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct imx8qxp_adc *adc = iio_priv(indio_dev);
@@ -430,7 +430,7 @@ static int imx8qxp_adc_runtime_suspend(struct device *dev)
return 0;
}

-static int imx8qxp_adc_runtime_resume(struct device *dev)
+static int __maybe_unused imx8qxp_adc_runtime_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct imx8qxp_adc *adc = iio_priv(indio_dev);
--
2.25.1


2021-10-13 04:33:20

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH] iio: imx8qxp-adc: Fix the error - defined but not used for runtime pm API

On 10/12/21 6:46 PM, Cai Huoqing wrote:
> Add the prefix '__maybe_unused' to imx8qxp_adc_runtime_suspend/resume()
> to avoid the compiler complain without setting CONFIG_SUSPEND,
> CONFIG_HIBERNATION and CONFIG_PM.
>
> Signed-off-by: Cai Huoqing <[email protected]>

Acked-by: Randy Dunlap <[email protected]> # build-tested

Thanks.

> ---
> drivers/iio/adc/imx8qxp-adc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/imx8qxp-adc.c b/drivers/iio/adc/imx8qxp-adc.c
> index 5030e0d8318d..011bef4b5dda 100644
> --- a/drivers/iio/adc/imx8qxp-adc.c
> +++ b/drivers/iio/adc/imx8qxp-adc.c
> @@ -416,7 +416,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)
> return 0;
> }
>
> -static int imx8qxp_adc_runtime_suspend(struct device *dev)
> +static int __maybe_unused imx8qxp_adc_runtime_suspend(struct device *dev)
> {
> struct iio_dev *indio_dev = dev_get_drvdata(dev);
> struct imx8qxp_adc *adc = iio_priv(indio_dev);
> @@ -430,7 +430,7 @@ static int imx8qxp_adc_runtime_suspend(struct device *dev)
> return 0;
> }
>
> -static int imx8qxp_adc_runtime_resume(struct device *dev)
> +static int __maybe_unused imx8qxp_adc_runtime_resume(struct device *dev)
> {
> struct iio_dev *indio_dev = dev_get_drvdata(dev);
> struct imx8qxp_adc *adc = iio_priv(indio_dev);
>


--
~Randy