]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mfd: tps65912: Move regmap config into core driver
authorArnd Bergmann <arnd@arndb.de>
Thu, 15 Sep 2016 11:35:30 +0000 (13:35 +0200)
committerLee Jones <lee.jones@linaro.org>
Tue, 29 Nov 2016 08:21:21 +0000 (08:21 +0000)
When building with extra warnings enabled, most files including
linux/mfd/tps65912.h warn about a static variable defined in the
header:

include/linux/mfd/tps65912.h:331:35: warning: 'tps65912_regmap_config' defined but not used [-Wunused-const-variable=]

We also duplicate the data structure between the i2c and spi front-end
drivers. Moving it into the driver code avoids the warning and
the duplication.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/tps65912-core.c
include/linux/mfd/tps65912.h

index a88cfa80dbc4816f3c236d4c4282f59af09893e0..f33567bc428d1f7a2a6e00ef1b962ea8851d417c 100644 (file)
@@ -77,6 +77,23 @@ static struct regmap_irq_chip tps65912_irq_chip = {
        .init_ack_masked = true,
 };
 
+static const struct regmap_range tps65912_yes_ranges[] = {
+       regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
+};
+
+static const struct regmap_access_table tps65912_volatile_table = {
+       .yes_ranges = tps65912_yes_ranges,
+       .n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
+};
+
+const struct regmap_config tps65912_regmap_config = {
+       .reg_bits = 8,
+       .val_bits = 8,
+       .cache_type = REGCACHE_RBTREE,
+       .volatile_table = &tps65912_volatile_table,
+};
+EXPORT_SYMBOL_GPL(tps65912_regmap_config);
+
 int tps65912_device_init(struct tps65912 *tps)
 {
        int ret;
index 1a603701550e33e51dd2f4c78a5d4311abc0112a..b25d0297ba887a901da8dd5349ac777e908da533 100644 (file)
@@ -319,21 +319,7 @@ struct tps65912 {
        struct regmap_irq_chip_data *irq_data;
 };
 
-static const struct regmap_range tps65912_yes_ranges[] = {
-       regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
-};
-
-static const struct regmap_access_table tps65912_volatile_table = {
-       .yes_ranges = tps65912_yes_ranges,
-       .n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
-};
-
-static const struct regmap_config tps65912_regmap_config = {
-       .reg_bits = 8,
-       .val_bits = 8,
-       .cache_type = REGCACHE_RBTREE,
-       .volatile_table = &tps65912_volatile_table,
-};
+extern const struct regmap_config tps65912_regmap_config;
 
 int tps65912_device_init(struct tps65912 *tps);
 int tps65912_device_exit(struct tps65912 *tps);