Linux Power Management development
 help / color / mirror / Atom feed
From: Rui Miguel Silva <rui.silva@linaro.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	linux-pm@vger.kernel.org, Paul Cercueil <paul@crapouillou.net>,
	Sean Nyekjaer <sean@geanix.com>,
	Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH 3/5] iio: gyro: fxas210002c: Move exports to IIO_FXAS210002C namespace.
Date: Mon, 8 Aug 2022 12:00:42 +0100	[thread overview]
Message-ID: <20220808110042.wc6x6z4pmphha5in@arch-thunder> (raw)
In-Reply-To: <20220807192038.1039771-4-jic23@kernel.org>

Hey Jonathan,
On Sun, Aug 07, 2022 at 08:20:36PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Includes using EXPORT_NS_GPL_DEV_PM_OPS() and the simplifications that
> brings by allowing the compiler to remove unused struct dev_pm_ops
> and callbacks without needing explicit __maybe_unused markings.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Rui Miguel Silva <rui.silva@linaro.org>

This looks a sane and good improvement, thanks.

Acked-by: Rui Miguel Silva <rui.silva@linaro.org>

Cheers,
     Rui

> ---
>  drivers/iio/gyro/fxas21002c_core.c | 21 +++++++++------------
>  drivers/iio/gyro/fxas21002c_i2c.c  |  3 ++-
>  drivers/iio/gyro/fxas21002c_spi.c  |  3 ++-
>  3 files changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/iio/gyro/fxas21002c_core.c b/drivers/iio/gyro/fxas21002c_core.c
> index a36d71d9e3ea..9aee9096363f 100644
> --- a/drivers/iio/gyro/fxas21002c_core.c
> +++ b/drivers/iio/gyro/fxas21002c_core.c
> @@ -998,7 +998,7 @@ int fxas21002c_core_probe(struct device *dev, struct regmap *regmap, int irq,
>  
>  	return ret;
>  }
> -EXPORT_SYMBOL_GPL(fxas21002c_core_probe);
> +EXPORT_SYMBOL_NS_GPL(fxas21002c_core_probe, IIO_FXAS21002C);
>  
>  void fxas21002c_core_remove(struct device *dev)
>  {
> @@ -1009,9 +1009,9 @@ void fxas21002c_core_remove(struct device *dev)
>  	pm_runtime_disable(dev);
>  	pm_runtime_set_suspended(dev);
>  }
> -EXPORT_SYMBOL_GPL(fxas21002c_core_remove);
> +EXPORT_SYMBOL_NS_GPL(fxas21002c_core_remove, IIO_FXAS21002C);
>  
> -static int __maybe_unused fxas21002c_suspend(struct device *dev)
> +static int fxas21002c_suspend(struct device *dev)
>  {
>  	struct fxas21002c_data *data = iio_priv(dev_get_drvdata(dev));
>  
> @@ -1021,7 +1021,7 @@ static int __maybe_unused fxas21002c_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused fxas21002c_resume(struct device *dev)
> +static int fxas21002c_resume(struct device *dev)
>  {
>  	struct fxas21002c_data *data = iio_priv(dev_get_drvdata(dev));
>  	int ret;
> @@ -1033,26 +1033,23 @@ static int __maybe_unused fxas21002c_resume(struct device *dev)
>  	return fxas21002c_mode_set(data, data->prev_mode);
>  }
>  
> -static int __maybe_unused fxas21002c_runtime_suspend(struct device *dev)
> +static int fxas21002c_runtime_suspend(struct device *dev)
>  {
>  	struct fxas21002c_data *data = iio_priv(dev_get_drvdata(dev));
>  
>  	return fxas21002c_mode_set(data, FXAS21002C_MODE_READY);
>  }
>  
> -static int __maybe_unused fxas21002c_runtime_resume(struct device *dev)
> +static int fxas21002c_runtime_resume(struct device *dev)
>  {
>  	struct fxas21002c_data *data = iio_priv(dev_get_drvdata(dev));
>  
>  	return fxas21002c_mode_set(data, FXAS21002C_MODE_ACTIVE);
>  }
>  
> -const struct dev_pm_ops fxas21002c_pm_ops = {
> -	SET_SYSTEM_SLEEP_PM_OPS(fxas21002c_suspend, fxas21002c_resume)
> -	SET_RUNTIME_PM_OPS(fxas21002c_runtime_suspend,
> -			   fxas21002c_runtime_resume, NULL)
> -};
> -EXPORT_SYMBOL_GPL(fxas21002c_pm_ops);
> +EXPORT_NS_GPL_DEV_PM_OPS(fxas21002c_pm_ops, fxas21002c_suspend,
> +			 fxas21002c_resume, fxas21002c_runtime_suspend,
> +			 fxas21002c_runtime_resume, NULL, IIO_FXAS21002C);
>  
>  MODULE_AUTHOR("Rui Miguel Silva <rui.silva@linaro.org>");
>  MODULE_LICENSE("GPL v2");
> diff --git a/drivers/iio/gyro/fxas21002c_i2c.c b/drivers/iio/gyro/fxas21002c_i2c.c
> index a7807fd97483..241401a9dfea 100644
> --- a/drivers/iio/gyro/fxas21002c_i2c.c
> +++ b/drivers/iio/gyro/fxas21002c_i2c.c
> @@ -55,7 +55,7 @@ MODULE_DEVICE_TABLE(of, fxas21002c_i2c_of_match);
>  static struct i2c_driver fxas21002c_i2c_driver = {
>  	.driver = {
>  		.name = "fxas21002c_i2c",
> -		.pm = &fxas21002c_pm_ops,
> +		.pm = pm_ptr(&fxas21002c_pm_ops),
>  		.of_match_table = fxas21002c_i2c_of_match,
>  	},
>  	.probe_new	= fxas21002c_i2c_probe,
> @@ -67,3 +67,4 @@ module_i2c_driver(fxas21002c_i2c_driver);
>  MODULE_AUTHOR("Rui Miguel Silva <rui.silva@linaro.org>");
>  MODULE_LICENSE("GPL v2");
>  MODULE_DESCRIPTION("FXAS21002C I2C Gyro driver");
> +MODULE_IMPORT_NS(IIO_FXAS21002C);
> diff --git a/drivers/iio/gyro/fxas21002c_spi.c b/drivers/iio/gyro/fxas21002c_spi.c
> index c3ac169facf9..4f633826547c 100644
> --- a/drivers/iio/gyro/fxas21002c_spi.c
> +++ b/drivers/iio/gyro/fxas21002c_spi.c
> @@ -54,7 +54,7 @@ MODULE_DEVICE_TABLE(of, fxas21002c_spi_of_match);
>  static struct spi_driver fxas21002c_spi_driver = {
>  	.driver = {
>  		.name = "fxas21002c_spi",
> -		.pm = &fxas21002c_pm_ops,
> +		.pm = pm_ptr(&fxas21002c_pm_ops),
>  		.of_match_table = fxas21002c_spi_of_match,
>  	},
>  	.probe		= fxas21002c_spi_probe,
> @@ -66,3 +66,4 @@ module_spi_driver(fxas21002c_spi_driver);
>  MODULE_AUTHOR("Rui Miguel Silva <rui.silva@linaro.org>");
>  MODULE_LICENSE("GPL v2");
>  MODULE_DESCRIPTION("FXAS21002C SPI Gyro driver");
> +MODULE_IMPORT_NS(IIO_FXAS21002C);
> -- 
> 2.37.1
> 

  reply	other threads:[~2022-08-08 11:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-07 19:20 [PATCH 0/5] PM: Introduce EXPORT_NS_GPL_DEV_PM_OPS() and use cases in IIO Jonathan Cameron
2022-08-07 19:20 ` [PATCH 1/5] PM: core: Add EXPORT_NS_GPL_DEV_PM_OPS to avoid drivers rolling own Jonathan Cameron
2022-08-08 11:22   ` Paul Cercueil
2022-08-13 16:14     ` Jonathan Cameron
2022-08-07 19:20 ` [PATCH 2/5] iio: accel: fxls8962af: Use new EXPORT_NS_GPL_DEV_PM_OPS() Jonathan Cameron
2022-08-08 11:37   ` Sean Nyekjaer
2022-08-07 19:20 ` [PATCH 3/5] iio: gyro: fxas210002c: Move exports to IIO_FXAS210002C namespace Jonathan Cameron
2022-08-08 11:00   ` Rui Miguel Silva [this message]
2022-08-07 19:20 ` [PATCH 4/5] iio: imu: inv_icm42600: Move exports to IIO_ICM42600 namespace Jonathan Cameron
2022-08-07 19:20 ` [PATCH 5/5] iio: imu: inv_mpu: Move exports to IIO_MPU6050 namespace Jonathan Cameron
2022-08-22  8:59   ` Linus Walleij
2022-08-08  9:36 ` [PATCH 0/5] PM: Introduce EXPORT_NS_GPL_DEV_PM_OPS() and use cases in IIO Andy Shevchenko
2022-08-22  9:04 ` Linus Walleij
2022-08-22 18:59   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220808110042.wc6x6z4pmphha5in@arch-thunder \
    --to=rui.silva@linaro.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jic23@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=paul@crapouillou.net \
    --cc=rafael@kernel.org \
    --cc=sean@geanix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox