Skip to content

Commit 3628d99

Browse files
mitaalexandrebelloni
authored andcommitted
rtc: ds3232: avoid unused-const-variable warning
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 <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202311172325.33tTniaJ-lkp@intel.com/ Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Link: https://lore.kernel.org/r/20231118092200.829808-1-akinobu.mita@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent cd0d7d6 commit 3628d99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/rtc/rtc-ds3232.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,8 @@ static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq,
536536
return 0;
537537
}
538538

539+
#if IS_ENABLED(CONFIG_I2C)
540+
539541
#ifdef CONFIG_PM_SLEEP
540542
static int ds3232_suspend(struct device *dev)
541543
{
@@ -564,8 +566,6 @@ static const struct dev_pm_ops ds3232_pm_ops = {
564566
SET_SYSTEM_SLEEP_PM_OPS(ds3232_suspend, ds3232_resume)
565567
};
566568

567-
#if IS_ENABLED(CONFIG_I2C)
568-
569569
static int ds3232_i2c_probe(struct i2c_client *client)
570570
{
571571
struct regmap *regmap;

0 commit comments

Comments
 (0)