archive mirror
 help / color / mirror / Atom feed
From: Akinobu Mita <>
Cc:,,, kernel test robot <>
Subject: [PATCH] rtc: ds3232: avoid unused-const-variable warning
Date: Sat, 18 Nov 2023 18:22:00 +0900	[thread overview]
Message-ID: <> (raw)

Fix the following warning when CONFIG_I2C is not set but CONFIG_SPI_MASTER
is set.

warning: 'ds3232_pm_ops' defined but not used [-Wunused-const-variable=]

'ds3232_pm_ops' is only used by rtc-ds3232 i2c driver, so move the device
PM callbacks inside #if IS_ENABLED(CONFIG_I2C).

Reported-by: kernel test robot <>
Signed-off-by: Akinobu Mita <>
 drivers/rtc/rtc-ds3232.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c
index 89d7b085f721..1485a6ae51e6 100644
--- a/drivers/rtc/rtc-ds3232.c
+++ b/drivers/rtc/rtc-ds3232.c
@@ -536,6 +536,8 @@ static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq,
 	return 0;
 static int ds3232_suspend(struct device *dev)
@@ -564,8 +566,6 @@ static const struct dev_pm_ops ds3232_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(ds3232_suspend, ds3232_resume)
 static int ds3232_i2c_probe(struct i2c_client *client)
 	struct regmap *regmap;

             reply	other threads:[~2023-11-18  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-18  9:22 Akinobu Mita [this message]
2024-01-08  0:31 ` [PATCH] rtc: ds3232: avoid unused-const-variable warning Alexandre Belloni

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:

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

  git send-email \ \ \ \ \ \ \

* 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).