From: Stefan Agner <stefan@agner.ch>
To: Axel Lin <axel.lin@ingics.com>
Cc: Mark Brown <broonie@kernel.org>,
Leonard Crestez <leonard.crestez@nxp.com>,
Pierre-Hugues Husson <phh@phh.me>,
Beniamino Galvani <b.galvani@gmail.com>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: rn5t618: Constify regulator_desc
Date: Sat, 23 Mar 2019 09:34:13 +0100 [thread overview]
Message-ID: <6730c8bd06d5052439adaa2c66f68ea7@agner.ch> (raw)
In-Reply-To: <20190320121057.31167-1-axel.lin@ingics.com>
On 20.03.2019 13:10, Axel Lin wrote:
> The regulator_desc never need to be modified, so define them as const as a
> hint to the compiler that they can go into .rodata.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Looks good to me.
Reviewed-by: Stefan Agner <stefan@agner.ch>
--
Stefan
> ---
> drivers/regulator/rn5t618-regulator.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/regulator/rn5t618-regulator.c
> b/drivers/regulator/rn5t618-regulator.c
> index 790a4a73ea2c..a79c0c43b9f8 100644
> --- a/drivers/regulator/rn5t618-regulator.c
> +++ b/drivers/regulator/rn5t618-regulator.c
> @@ -46,7 +46,7 @@ static const struct regulator_ops rn5t618_reg_ops = {
> .vsel_mask = (vmask), \
> }
>
> -static struct regulator_desc rn5t567_regulators[] = {
> +static const struct regulator_desc rn5t567_regulators[] = {
> /* DCDC */
> REG(DCDC1, DC1CTL, BIT(0), DC1DAC, 0xff, 600000, 3500000, 12500),
> REG(DCDC2, DC2CTL, BIT(0), DC2DAC, 0xff, 600000, 3500000, 12500),
> @@ -63,7 +63,7 @@ static struct regulator_desc rn5t567_regulators[] = {
> REG(LDORTC2, LDOEN2, BIT(5), LDORTC2DAC, 0x7f, 900000, 3500000, 25000),
> };
>
> -static struct regulator_desc rn5t618_regulators[] = {
> +static const struct regulator_desc rn5t618_regulators[] = {
> /* DCDC */
> REG(DCDC1, DC1CTL, BIT(0), DC1DAC, 0xff, 600000, 3500000, 12500),
> REG(DCDC2, DC2CTL, BIT(0), DC2DAC, 0xff, 600000, 3500000, 12500),
> @@ -79,7 +79,7 @@ static struct regulator_desc rn5t618_regulators[] = {
> REG(LDORTC2, LDOEN2, BIT(5), LDORTC2DAC, 0x7f, 900000, 3500000, 25000),
> };
>
> -static struct regulator_desc rc5t619_regulators[] = {
> +static const struct regulator_desc rc5t619_regulators[] = {
> /* DCDC */
> REG(DCDC1, DC1CTL, BIT(0), DC1DAC, 0xff, 600000, 3500000, 12500),
> REG(DCDC2, DC2CTL, BIT(0), DC2DAC, 0xff, 600000, 3500000, 12500),
> @@ -107,7 +107,7 @@ static int rn5t618_regulator_probe(struct
> platform_device *pdev)
> struct rn5t618 *rn5t618 = dev_get_drvdata(pdev->dev.parent);
> struct regulator_config config = { };
> struct regulator_dev *rdev;
> - struct regulator_desc *regulators;
> + const struct regulator_desc *regulators;
> int i;
> int num_regulators = 0;
prev parent reply other threads:[~2019-03-23 8:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 12:10 Axel Lin
2019-03-23 8:34 ` Stefan Agner [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=6730c8bd06d5052439adaa2c66f68ea7@agner.ch \
--to=stefan@agner.ch \
--cc=axel.lin@ingics.com \
--cc=b.galvani@gmail.com \
--cc=broonie@kernel.org \
--cc=leonard.crestez@nxp.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=phh@phh.me \
/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
Powered by JetHome