diff mbox series

iio: imx8qxp-adc: mark PM functions as __maybe_unused

Message ID 20211013144338.2261316-1-arnd@kernel.org (mailing list archive)
State Accepted
Headers show
Series iio: imx8qxp-adc: mark PM functions as __maybe_unused | expand

Commit Message

Arnd Bergmann Oct. 13, 2021, 2:43 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

Without CONFIG_PM_SLEEP, the runtime suspend/resume functions
are unused, producing a warning:

drivers/iio/adc/imx8qxp-adc.c:433:12: error: 'imx8qxp_adc_runtime_resume' defined but not used [-Werror=unused-function]
  433 | static int imx8qxp_adc_runtime_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/adc/imx8qxp-adc.c:419:12: error: 'imx8qxp_adc_runtime_suspend' defined but not used [-Werror=unused-function]
  419 | static int imx8qxp_adc_runtime_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Mark them as __maybe_unused to shut up the compiler.

Fixes: 7bce634d02e6 ("iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/iio/adc/imx8qxp-adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Cai,Huoqing Oct. 14, 2021, 1:29 a.m. UTC | #1
On 13 10月 21 16:43:26, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Without CONFIG_PM_SLEEP, the runtime suspend/resume functions
> are unused, producing a warning:
> 
> drivers/iio/adc/imx8qxp-adc.c:433:12: error: 'imx8qxp_adc_runtime_resume' defined but not used [-Werror=unused-function]
>   433 | static int imx8qxp_adc_runtime_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/iio/adc/imx8qxp-adc.c:419:12: error: 'imx8qxp_adc_runtime_suspend' defined but not used [-Werror=unused-function]
>   419 | static int imx8qxp_adc_runtime_suspend(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Mark them as __maybe_unused to shut up the compiler.
> 
> Fixes: 7bce634d02e6 ("iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Cai Huoqing <caihuoqing@baidu.com>

> ---
>  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..901dd8e1b32f 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 __maybe_unused int 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 __maybe_unused int 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.29.2
>
Randy Dunlap Oct. 14, 2021, 1:40 a.m. UTC | #2
On 10/13/21 6:29 PM, Cai Huoqing wrote:
> On 13 10月 21 16:43:26, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Without CONFIG_PM_SLEEP, the runtime suspend/resume functions
>> are unused, producing a warning:
>>
>> drivers/iio/adc/imx8qxp-adc.c:433:12: error: 'imx8qxp_adc_runtime_resume' defined but not used [-Werror=unused-function]
>>    433 | static int imx8qxp_adc_runtime_resume(struct device *dev)
>>        |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/iio/adc/imx8qxp-adc.c:419:12: error: 'imx8qxp_adc_runtime_suspend' defined but not used [-Werror=unused-function]
>>    419 | static int imx8qxp_adc_runtime_suspend(struct device *dev)
>>        |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Mark them as __maybe_unused to shut up the compiler.
>>
>> Fixes: 7bce634d02e6 ("iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Reviewed-by: Cai Huoqing <caihuoqing@baidu.com>

Looks the same as
https://lore.kernel.org/all/20211013014658.2798-1-caihuoqing@baidu.com/

but that one is mixing the Fixes: tag.

>> ---
>>   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..901dd8e1b32f 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 __maybe_unused int 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 __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev)
>>   {
>>   	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>>   	struct imx8qxp_adc *adc = iio_priv(indio_dev);
>> --
Jonathan Cameron Oct. 14, 2021, 5:44 p.m. UTC | #3
On Wed, 13 Oct 2021 18:40:41 -0700
Randy Dunlap <rdunlap@infradead.org> wrote:

> On 10/13/21 6:29 PM, Cai Huoqing wrote:
> > On 13 10月 21 16:43:26, Arnd Bergmann wrote:  
> >> From: Arnd Bergmann <arnd@arndb.de>
> >>
> >> Without CONFIG_PM_SLEEP, the runtime suspend/resume functions
> >> are unused, producing a warning:
> >>
> >> drivers/iio/adc/imx8qxp-adc.c:433:12: error: 'imx8qxp_adc_runtime_resume' defined but not used [-Werror=unused-function]
> >>    433 | static int imx8qxp_adc_runtime_resume(struct device *dev)
> >>        |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
> >> drivers/iio/adc/imx8qxp-adc.c:419:12: error: 'imx8qxp_adc_runtime_suspend' defined but not used [-Werror=unused-function]
> >>    419 | static int imx8qxp_adc_runtime_suspend(struct device *dev)
> >>        |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>
> >> Mark them as __maybe_unused to shut up the compiler.
> >>
> >> Fixes: 7bce634d02e6 ("iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC")
> >> Signed-off-by: Arnd Bergmann <arnd@arndb.de>  
> > 
> > Reviewed-by: Cai Huoqing <caihuoqing@baidu.com>  
> 
> Looks the same as
> https://lore.kernel.org/all/20211013014658.2798-1-caihuoqing@baidu.com/
> 
> but that one is mixing the Fixes: tag.

Given Cai replied to this one and the presence of the fixes tag + my inherent
laziness, applied this one to the togreg branch of iio.git. I'll push that
out as testing to let 0-day poke it before pushing it out for next to pick up
in a day or 2.

Thanks,

Jonathan

> 
> >> ---
> >>   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..901dd8e1b32f 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 __maybe_unused int 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 __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev)
> >>   {
> >>   	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> >>   	struct imx8qxp_adc *adc = iio_priv(indio_dev);
> >> --   
> 
> 
> 
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/imx8qxp-adc.c b/drivers/iio/adc/imx8qxp-adc.c
index 5030e0d8318d..901dd8e1b32f 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 __maybe_unused int 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 __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct imx8qxp_adc *adc = iio_priv(indio_dev);