linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Yves MORDRET <pierre-yves.mordret@foss.st.com>
To: Alain Volmat <alain.volmat@foss.st.com>, <wsa@kernel.org>
Cc: <alexandre.torgue@foss.st.com>, <linux-i2c@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <fabrice.gasnier@foss.st.com>
Subject: Re: [PATCH] i2c: stm32f7: avoid ifdef CONFIG_PM_SLEEP for pm callbacks
Date: Thu, 18 Mar 2021 14:05:31 +0100	[thread overview]
Message-ID: <5f412da7-1915-b2dc-a21a-56055991e96c@foss.st.com> (raw)
In-Reply-To: <1615550007-10927-1-git-send-email-alain.volmat@foss.st.com>

Hi All,

Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com>

Regards

On 3/12/21 12:53 PM, Alain Volmat wrote:
> Avoid CONFIG_PM preprocessor check for pm suspend/resume
> callbacks and identify the functions with __maybe_unused.
> 
> Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
> ---
>  drivers/i2c/busses/i2c-stm32f7.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> index c62c815b88eb..4c2f1b16c5ce 100644
> --- a/drivers/i2c/busses/i2c-stm32f7.c
> +++ b/drivers/i2c/busses/i2c-stm32f7.c
> @@ -2267,8 +2267,7 @@ static int __maybe_unused stm32f7_i2c_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
> -static int stm32f7_i2c_regs_backup(struct stm32f7_i2c_dev *i2c_dev)
> +static int __maybe_unused stm32f7_i2c_regs_backup(struct stm32f7_i2c_dev *i2c_dev)
>  {
>  	int ret;
>  	struct stm32f7_i2c_regs *backup_regs = &i2c_dev->backup_regs;
> @@ -2289,7 +2288,7 @@ static int stm32f7_i2c_regs_backup(struct stm32f7_i2c_dev *i2c_dev)
>  	return ret;
>  }
>  
> -static int stm32f7_i2c_regs_restore(struct stm32f7_i2c_dev *i2c_dev)
> +static int __maybe_unused stm32f7_i2c_regs_restore(struct stm32f7_i2c_dev *i2c_dev)
>  {
>  	u32 cr1;
>  	int ret;
> @@ -2320,7 +2319,7 @@ static int stm32f7_i2c_regs_restore(struct stm32f7_i2c_dev *i2c_dev)
>  	return ret;
>  }
>  
> -static int stm32f7_i2c_suspend(struct device *dev)
> +static int __maybe_unused stm32f7_i2c_suspend(struct device *dev)
>  {
>  	struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev);
>  	int ret;
> @@ -2341,7 +2340,7 @@ static int stm32f7_i2c_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int stm32f7_i2c_resume(struct device *dev)
> +static int __maybe_unused stm32f7_i2c_resume(struct device *dev)
>  {
>  	struct stm32f7_i2c_dev *i2c_dev = dev_get_drvdata(dev);
>  	int ret;
> @@ -2361,7 +2360,6 @@ static int stm32f7_i2c_resume(struct device *dev)
>  
>  	return 0;
>  }
> -#endif
>  
>  static const struct dev_pm_ops stm32f7_i2c_pm_ops = {
>  	SET_RUNTIME_PM_OPS(stm32f7_i2c_runtime_suspend,
> 

-- 
--
~ Py MORDRET
--

  reply	other threads:[~2021-03-18 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 11:53 [PATCH] i2c: stm32f7: avoid ifdef CONFIG_PM_SLEEP for pm callbacks Alain Volmat
2021-03-18 13:05 ` Pierre Yves MORDRET [this message]
2021-04-06 20:40 ` Wolfram Sang

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=5f412da7-1915-b2dc-a21a-56055991e96c@foss.st.com \
    --to=pierre-yves.mordret@foss.st.com \
    --cc=alain.volmat@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=wsa@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).