Re: [PATCH 51/69] Input: iqs5xx - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 02, 2023 at 06:18:24PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> 
> SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
> against unused function warnings.  The new combination of pm_sleep_ptr()
> and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
> thus suppressing the warning, but still allowing the unused code to be
> removed. Thus also drop the __maybe_unused markings.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> Cc: Jeff LaBundy <jeff@xxxxxxxxxxx>

Reviewed-by: Jeff LaBundy <jeff@xxxxxxxxxxx>

> ---
>  drivers/input/touchscreen/iqs5xx.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c
> index dc3137a34f35..c73e9c5c0077 100644
> --- a/drivers/input/touchscreen/iqs5xx.c
> +++ b/drivers/input/touchscreen/iqs5xx.c
> @@ -979,7 +979,7 @@ static const struct attribute_group iqs5xx_attr_group = {
>  	.attrs = iqs5xx_attrs,
>  };
>  
> -static int __maybe_unused iqs5xx_suspend(struct device *dev)
> +static int iqs5xx_suspend(struct device *dev)
>  {
>  	struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev);
>  	struct input_dev *input = iqs5xx->input;
> @@ -998,7 +998,7 @@ static int __maybe_unused iqs5xx_suspend(struct device *dev)
>  	return error;
>  }
>  
> -static int __maybe_unused iqs5xx_resume(struct device *dev)
> +static int iqs5xx_resume(struct device *dev)
>  {
>  	struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev);
>  	struct input_dev *input = iqs5xx->input;
> @@ -1017,7 +1017,7 @@ static int __maybe_unused iqs5xx_resume(struct device *dev)
>  	return error;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume);
>  
>  static int iqs5xx_probe(struct i2c_client *client)
>  {
> @@ -1090,7 +1090,7 @@ static struct i2c_driver iqs5xx_i2c_driver = {
>  	.driver = {
>  		.name		= "iqs5xx",
>  		.of_match_table	= iqs5xx_of_match,
> -		.pm		= &iqs5xx_pm,
> +		.pm		= pm_sleep_ptr(&iqs5xx_pm),
>  	},
>  	.id_table	= iqs5xx_id,
>  	.probe_new	= iqs5xx_probe,
> -- 
> 2.39.0
> 



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux