From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org,
Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: [PATCH 4/8] regulator: tps65086: Constify static regulator_ops
Date: Sun, 30 Aug 2020 00:11:00 +0200 [thread overview]
Message-ID: <20200829221104.20870-5-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20200829221104.20870-1-rikard.falkeborn@gmail.com>
The only usage of reg_ops and switch_ops is to assign their addresses to
the ops field in the regulator_desc struct, which is a const pointer.
Make them const to allow the compiler to put them in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/regulator/tps65086-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/tps65086-regulator.c b/drivers/regulator/tps65086-regulator.c
index 23528475a962..070c956216b0 100644
--- a/drivers/regulator/tps65086-regulator.c
+++ b/drivers/regulator/tps65086-regulator.c
@@ -101,7 +101,7 @@ static const struct linear_range tps65086_ldoa23_ranges[] = {
};
/* Operations permitted on regulators */
-static struct regulator_ops reg_ops = {
+static const struct regulator_ops reg_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
@@ -112,7 +112,7 @@ static struct regulator_ops reg_ops = {
};
/* Operations permitted on load switches */
-static struct regulator_ops switch_ops = {
+static const struct regulator_ops switch_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
--
2.28.0
next prev parent reply other threads:[~2020-08-29 22:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-29 22:10 [PATCH 0/8] regulator/tps*: Constify static regulator ops Rikard Falkeborn
2020-08-29 22:10 ` [PATCH 1/8] regulator: tps51632: Constify tps51632_dcdc_ops Rikard Falkeborn
2020-08-29 22:10 ` [PATCH 2/8] regulator: tps6105x: Constify tps6105x_regulator_ops Rikard Falkeborn
2020-08-29 22:10 ` [PATCH 3/8] regulator: tps62360: Constify tps62360_dcdc_ops Rikard Falkeborn
2020-08-29 22:11 ` Rikard Falkeborn [this message]
2020-08-29 22:11 ` [PATCH 5/8] regulator: tps65090: constify static regulator_ops Rikard Falkeborn
2020-08-29 22:11 ` [PATCH 6/8] regulator: tps6586x: Constify " Rikard Falkeborn
2020-08-29 22:11 ` [PATCH 7/8] regulator: tps65912: " Rikard Falkeborn
2020-08-29 22:11 ` [PATCH 8/8] regulator: tps65910: " Rikard Falkeborn
2020-09-01 14:50 ` [PATCH 0/8] regulator/tps*: Constify static regulator ops Mark Brown
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=20200829221104.20870-5-rikard.falkeborn@gmail.com \
--to=rikard.falkeborn@gmail.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®