]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtc: pcf85063: scope pcf85063_config structures
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 24 Jul 2025 09:04:19 +0000 (11:04 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sat, 26 Jul 2025 22:14:59 +0000 (00:14 +0200)
Fix possible warning:
>> drivers/rtc/rtc-pcf85063.c:566:37: warning: unused variable 'config_rv8063' [-Wunused-const-variable]
     566 | static const struct pcf85063_config config_rv8063 = {
         |                                     ^~~~~~~~~~~~~

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507241607.dmz2qrO5-lkp@intel.com/
Link: https://lore.kernel.org/r/20250724090420.917705-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-pcf85063.c

index d9b67b959d18fa42dff06adbce6e0ec27ccd2ed0..e3b58cdb1eda729ab26a5a782f63d9d006a879e4 100644 (file)
@@ -528,53 +528,6 @@ static struct clk *pcf85063_clkout_register_clk(struct pcf85063 *pcf85063)
 }
 #endif
 
-static const struct pcf85063_config config_pcf85063 = {
-       .regmap = {
-               .reg_bits = 8,
-               .val_bits = 8,
-               .max_register = 0x0a,
-       },
-};
-
-static const struct pcf85063_config config_pcf85063tp = {
-       .regmap = {
-               .reg_bits = 8,
-               .val_bits = 8,
-               .max_register = 0x0a,
-       },
-};
-
-static const struct pcf85063_config config_pcf85063a = {
-       .regmap = {
-               .reg_bits = 8,
-               .val_bits = 8,
-               .max_register = 0x11,
-       },
-       .has_alarms = 1,
-};
-
-static const struct pcf85063_config config_rv8263 = {
-       .regmap = {
-               .reg_bits = 8,
-               .val_bits = 8,
-               .max_register = 0x11,
-       },
-       .has_alarms = 1,
-       .force_cap_7000 = 1,
-};
-
-static const struct pcf85063_config config_rv8063 = {
-       .regmap = {
-               .reg_bits = 8,
-               .val_bits = 8,
-               .max_register = 0x11,
-               .read_flag_mask = BIT(7) | BIT(5),
-               .write_flag_mask = BIT(5),
-       },
-       .has_alarms = 1,
-       .force_cap_7000 = 1,
-};
-
 static int pcf85063_probe(struct device *dev, struct regmap *regmap, int irq,
                          const struct pcf85063_config *config)
 {
@@ -671,6 +624,41 @@ static int pcf85063_probe(struct device *dev, struct regmap *regmap, int irq,
 
 #if IS_ENABLED(CONFIG_I2C)
 
+static const struct pcf85063_config config_pcf85063 = {
+       .regmap = {
+               .reg_bits = 8,
+               .val_bits = 8,
+               .max_register = 0x0a,
+       },
+};
+
+static const struct pcf85063_config config_pcf85063tp = {
+       .regmap = {
+               .reg_bits = 8,
+               .val_bits = 8,
+               .max_register = 0x0a,
+       },
+};
+
+static const struct pcf85063_config config_pcf85063a = {
+       .regmap = {
+               .reg_bits = 8,
+               .val_bits = 8,
+               .max_register = 0x11,
+       },
+       .has_alarms = 1,
+};
+
+static const struct pcf85063_config config_rv8263 = {
+       .regmap = {
+               .reg_bits = 8,
+               .val_bits = 8,
+               .max_register = 0x11,
+       },
+       .has_alarms = 1,
+       .force_cap_7000 = 1,
+};
+
 static const struct i2c_device_id pcf85063_ids[] = {
        { "pca85073a", .driver_data = (kernel_ulong_t)&config_pcf85063a },
        { "pcf85063", .driver_data = (kernel_ulong_t)&config_pcf85063 },
@@ -743,6 +731,18 @@ static void pcf85063_unregister_driver(void)
 
 #if IS_ENABLED(CONFIG_SPI_MASTER)
 
+static const struct pcf85063_config config_rv8063 = {
+       .regmap = {
+               .reg_bits = 8,
+               .val_bits = 8,
+               .max_register = 0x11,
+               .read_flag_mask = BIT(7) | BIT(5),
+               .write_flag_mask = BIT(5),
+       },
+       .has_alarms = 1,
+       .force_cap_7000 = 1,
+};
+
 static const struct spi_device_id rv8063_id[] = {
        { "rv8063" },
        {}