From: Lee Jones <lee.jones@linaro.org>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH] mfd: syscon: make syscon_regmap_config const
Date: Fri, 29 Jan 2016 11:16:47 +0000 [thread overview]
Message-ID: <20160129111647.GU3368@x1> (raw)
In-Reply-To: <1454059816-3675-1-git-send-email-p.zabel@pengutronix.de>
On Fri, 29 Jan 2016, Philipp Zabel wrote:
> 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>
> ---
> drivers/mfd/syscon.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Applied, thanks.
> 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);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
prev parent reply other threads:[~2016-01-29 11:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 9:30 [PATCH] mfd: syscon: make syscon_regmap_config const Philipp Zabel
2016-01-29 11:16 ` Lee Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160129111647.GU3368@x1 \
--to=lee.jones@linaro.org \
--cc=arnd@arndb.de \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox