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 6/8] regulator: tps6586x: Constify static regulator_ops
Date: Sun, 30 Aug 2020 00:11:02 +0200 [thread overview]
Message-ID: <20200829221104.20870-7-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20200829221104.20870-1-rikard.falkeborn@gmail.com>
The only usage of these are to assign their address 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/tps6586x-regulator.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index 09e994e1f9a9..18bf4b885b08 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -60,7 +60,7 @@ struct tps6586x_regulator {
int enable_reg[2];
};
-static struct regulator_ops tps6586x_rw_regulator_ops = {
+static const struct regulator_ops tps6586x_rw_regulator_ops = {
.list_voltage = regulator_list_voltage_table,
.map_voltage = regulator_map_voltage_ascend,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
@@ -71,7 +71,7 @@ static struct regulator_ops tps6586x_rw_regulator_ops = {
.disable = regulator_disable_regmap,
};
-static struct regulator_ops tps6586x_rw_linear_regulator_ops = {
+static const struct regulator_ops tps6586x_rw_linear_regulator_ops = {
.list_voltage = regulator_list_voltage_linear,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
@@ -81,7 +81,7 @@ static struct regulator_ops tps6586x_rw_linear_regulator_ops = {
.disable = regulator_disable_regmap,
};
-static struct regulator_ops tps6586x_ro_regulator_ops = {
+static const struct regulator_ops tps6586x_ro_regulator_ops = {
.list_voltage = regulator_list_voltage_table,
.map_voltage = regulator_map_voltage_ascend,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
@@ -91,7 +91,7 @@ static struct regulator_ops tps6586x_ro_regulator_ops = {
.disable = regulator_disable_regmap,
};
-static struct regulator_ops tps6586x_sys_regulator_ops = {
+static const struct regulator_ops tps6586x_sys_regulator_ops = {
};
static const unsigned int tps6586x_ldo0_voltages[] = {
--
2.28.0
next prev parent reply other threads:[~2020-08-29 22:12 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 ` [PATCH 4/8] regulator: tps65086: Constify static regulator_ops Rikard Falkeborn
2020-08-29 22:11 ` [PATCH 5/8] regulator: tps65090: constify " Rikard Falkeborn
2020-08-29 22:11 ` Rikard Falkeborn [this message]
2020-08-29 22:11 ` [PATCH 7/8] regulator: tps65912: Constify " 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-7-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®