[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1454059816-3675-1-git-send-email-p.zabel@pengutronix.de>
Date: Fri, 29 Jan 2016 10:30:16 +0100
From: Philipp Zabel <p.zabel@...gutronix.de>
To: Lee Jones <lee.jones@...aro.org>
Cc: Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
kernel@...gutronix.de, Philipp Zabel <p.zabel@...gutronix.de>
Subject: [PATCH] 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@...gutronix.de>
---
drivers/mfd/syscon.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index b7aabee..b730071 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,
@@ -192,6 +192,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;
@@ -207,11 +208,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);
--
2.7.0.rc3
Powered by blists - more mailing lists