All of lore.kernel.org
 help / color / mirror / Atom feed
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 7/8] regulator: tps65912: Constify static regulator_ops
Date: Sun, 30 Aug 2020 00:11:03 +0200	[thread overview]
Message-ID: <20200829221104.20870-8-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20200829221104.20870-1-rikard.falkeborn@gmail.com>

The only usage of tps65912_ops_dcdc and tps65912_ops_ldo is 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/tps65912-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/tps65912-regulator.c b/drivers/regulator/tps65912-regulator.c
index 63d6bbd4969b..b52d4f2874b7 100644
--- a/drivers/regulator/tps65912-regulator.c
+++ b/drivers/regulator/tps65912-regulator.c
@@ -57,7 +57,7 @@ static const struct linear_range tps65912_ldo_ranges[] = {
 };
 
 /* Operations permitted on DCDCx */
-static struct regulator_ops tps65912_ops_dcdc = {
+static const struct regulator_ops tps65912_ops_dcdc = {
 	.is_enabled		= regulator_is_enabled_regmap,
 	.enable			= regulator_enable_regmap,
 	.disable		= regulator_disable_regmap,
@@ -67,7 +67,7 @@ static struct regulator_ops tps65912_ops_dcdc = {
 };
 
 /* Operations permitted on LDOx */
-static struct regulator_ops tps65912_ops_ldo = {
+static const struct regulator_ops tps65912_ops_ldo = {
 	.is_enabled		= regulator_is_enabled_regmap,
 	.enable			= regulator_enable_regmap,
 	.disable		= regulator_disable_regmap,
-- 
2.28.0


  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 ` [PATCH 5/8] regulator: tps65090: constify " Rikard Falkeborn
2020-08-29 22:11 ` [PATCH 6/8] regulator: tps6586x: Constify " Rikard Falkeborn
2020-08-29 22:11 ` Rikard Falkeborn [this message]
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-8-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.