linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: cros-ec: Constify cros_ec_regulator_voltage_ops
@ 2020-07-11 11:44 Rikard Falkeborn
  2020-07-11 11:57 ` [PATCH] const_structs.checkpatch: Add regulator_ops Joe Perches
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rikard Falkeborn @ 2020-07-11 11:44 UTC (permalink / raw)
  Cc: pihsun, lgirdwood, broonie, bleung, enric.balletbo, groeck,
	linux-kernel, Rikard Falkeborn

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-13 17:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11 11:44 [PATCH] regulator: cros-ec: Constify cros_ec_regulator_voltage_ops Rikard Falkeborn
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

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).