mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Platform: OLPC: Constify static struct regulator_ops
@ 2021-02-06 23:21 Rikard Falkeborn
  2021-02-08 19:01 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2021-02-06 23:21 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross
  Cc: platform-driver-x86, linux-kernel, Rikard Falkeborn

The only usage of it is to assign its address to the ops field in the
regulator_desc struct, which is a pointer to const struct regulator_ops.
Make it const to allow the compiler to put it in read-only memory.

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

diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c
index 72dbbea0005c..4ff5c3a12991 100644
--- a/drivers/platform/olpc/olpc-ec.c
+++ b/drivers/platform/olpc/olpc-ec.c
@@ -386,7 +386,7 @@ static int dcon_regulator_is_enabled(struct regulator_dev *rdev)
 	return ec->dcon_enabled ? 1 : 0;
 }
 
-static struct regulator_ops dcon_regulator_ops = {
+static const struct regulator_ops dcon_regulator_ops = {
 	.enable		= dcon_regulator_enable,
 	.disable	= dcon_regulator_disable,
 	.is_enabled	= dcon_regulator_is_enabled,
-- 
2.30.0


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

end of thread, other threads:[~2021-02-08 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-06 23:21 [PATCH] Platform: OLPC: Constify static struct regulator_ops Rikard Falkeborn
2021-02-08 19:01 ` Hans de Goede

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®