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 5/8] regulator: tps65090: constify static regulator_ops
Date: Sun, 30 Aug 2020 00:11:01 +0200 [thread overview]
Message-ID: <20200829221104.20870-6-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20200829221104.20870-1-rikard.falkeborn@gmail.com>
The only usages 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/tps65090-regulator.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c
index f0b660e9f15f..1d2e04f452d4 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -47,7 +47,7 @@ struct tps65090_regulator {
int overcurrent_wait;
};
-static struct regulator_ops tps65090_ext_control_ops = {
+static const struct regulator_ops tps65090_ext_control_ops = {
};
/**
@@ -167,19 +167,19 @@ static int tps65090_fet_enable(struct regulator_dev *rdev)
return ret;
}
-static struct regulator_ops tps65090_reg_control_ops = {
+static const struct regulator_ops tps65090_reg_control_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
};
-static struct regulator_ops tps65090_fet_control_ops = {
+static const struct regulator_ops tps65090_fet_control_ops = {
.enable = tps65090_fet_enable,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
};
-static struct regulator_ops tps65090_ldo_ops = {
+static const struct regulator_ops tps65090_ldo_ops = {
};
#define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _nvolt, _volt, _ops) \
--
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 ` [PATCH 4/8] regulator: tps65086: Constify static regulator_ops Rikard Falkeborn
2020-08-29 22:11 ` Rikard Falkeborn [this message]
2020-08-29 22:11 ` [PATCH 6/8] regulator: tps6586x: " 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-6-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®