summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2016-01-29 10:30:16 +0100
committerLee Jones <lee.jones@linaro.org>2016-03-16 08:50:18 +0000
commitc131045d5b074bcb749421c4b3f11f0655bdc0b6 (patch)
tree6d491cf37c414bc77415b5532e1e058491748bda /drivers/mfd
parentca668f0edfae65438c3f0a3ad5d3e59e3515915f (diff)
mfd: syscon: Make syscon_regmap_config const
syscon_regmap_config can be made const if syscon_probe() creates a local copy on the stack, just like syscon_register() does. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/syscon.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 99e8f88e6848..2f2225e845ef 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -36,7 +36,7 @@ struct syscon {
struct list_head list;
};
-static struct regmap_config syscon_regmap_config = {
+static const struct regmap_config syscon_regmap_config = {
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
@@ -199,6 +199,7 @@ static int syscon_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct syscon_platform_data *pdata = dev_get_platdata(dev);
struct syscon *syscon;
+ struct regmap_config syscon_config = syscon_regmap_config;
struct resource *res;
void __iomem *base;
@@ -214,11 +215,10 @@ static int syscon_probe(struct platform_device *pdev)
if (!base)
return -ENOMEM;
- syscon_regmap_config.max_register = res->end - res->start - 3;
+ syscon_config.max_register = res->end - res->start - 3;
if (pdata)
- syscon_regmap_config.name = pdata->label;
- syscon->regmap = devm_regmap_init_mmio(dev, base,
- &syscon_regmap_config);
+ syscon_config.name = pdata->label;
+ syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config);
if (IS_ERR(syscon->regmap)) {
dev_err(dev, "regmap init failed\n");
return PTR_ERR(syscon->regmap);