linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: pihsun@chromium.org, lgirdwood@gmail.com, broonie@kernel.org,
	bleung@chromium.org, enric.balletbo@collabora.com,
	groeck@chromium.org, linux-kernel@vger.kernel.org,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: [PATCH] regulator: cros-ec: Constify cros_ec_regulator_voltage_ops
Date: Sat, 11 Jul 2020 13:44:09 +0200	[thread overview]
Message-ID: <20200711114409.9911-1-rikard.falkeborn@gmail.com> (raw)

It is never modified, so make it const to allow the compiler to put it
in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/regulator/cros-ec-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/cros-ec-regulator.c b/drivers/regulator/cros-ec-regulator.c
index 35f97246bc48..eeed5aac3f32 100644
--- a/drivers/regulator/cros-ec-regulator.c
+++ b/drivers/regulator/cros-ec-regulator.c
@@ -142,7 +142,7 @@ static int cros_ec_regulator_set_voltage(struct regulator_dev *dev, int min_uV,
 			   sizeof(cmd), NULL, 0);
 }
 
-static struct regulator_ops cros_ec_regulator_voltage_ops = {
+static const struct regulator_ops cros_ec_regulator_voltage_ops = {
 	.enable = cros_ec_regulator_enable,
 	.disable = cros_ec_regulator_disable,
 	.is_enabled = cros_ec_regulator_is_enabled,
-- 
2.27.0


             reply	other threads:[~2020-07-11 11:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-11 11:44 Rikard Falkeborn [this message]
2020-07-11 11:57 ` [PATCH] const_structs.checkpatch: Add regulator_ops Joe Perches
2020-07-11 17:14   ` [PATCH] regulator: Use const regulator_ops when possible Joe Perches
2020-07-13  8:55 ` [PATCH] regulator: cros-ec: Constify cros_ec_regulator_voltage_ops Pi-Hsun Shih
2020-07-13 17:28 ` 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=20200711114409.9911-1-rikard.falkeborn@gmail.com \
    --to=rikard.falkeborn@gmail.com \
    --cc=bleung@chromium.org \
    --cc=broonie@kernel.org \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pihsun@chromium.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;
as well as URLs for NNTP newsgroup(s).