linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: s2m,s5m: constify regulator_ops structures
@ 2015-12-19 14:58 Julia Lawall
  2015-12-23  0:00 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2015-12-19 14:58 UTC (permalink / raw)
  To: Sangbeom Kim
  Cc: kernel-janitors, Krzysztof Kozlowski, Liam Girdwood, Mark Brown,
	linux-kernel, linux-samsung-soc

The regulator_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/regulator/s2mpa01.c |    4 ++--
 drivers/regulator/s2mps11.c |   16 ++++++++--------
 drivers/regulator/s5m8767.c |    4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/regulator/s2mpa01.c b/drivers/regulator/s2mpa01.c
index 92f8875..dc2105c 100644
--- a/drivers/regulator/s2mpa01.c
+++ b/drivers/regulator/s2mpa01.c
@@ -212,7 +212,7 @@ ramp_disable:
 				  1 << enable_shift, 0);
 }
 
-static struct regulator_ops s2mpa01_ldo_ops = {
+static const struct regulator_ops s2mpa01_ldo_ops = {
 	.list_voltage		= regulator_list_voltage_linear,
 	.map_voltage		= regulator_map_voltage_linear,
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -223,7 +223,7 @@ static struct regulator_ops s2mpa01_ldo_ops = {
 	.set_voltage_time_sel	= regulator_set_voltage_time_sel,
 };
 
-static struct regulator_ops s2mpa01_buck_ops = {
+static const struct regulator_ops s2mpa01_buck_ops = {
 	.list_voltage		= regulator_list_voltage_linear,
 	.map_voltage		= regulator_map_voltage_linear,
 	.is_enabled		= regulator_is_enabled_regmap,
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 3242ffc..e5be2ad 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -236,7 +236,7 @@ ramp_disable:
 				  1 << enable_shift, 0);
 }
 
-static struct regulator_ops s2mps11_ldo_ops = {
+static const struct regulator_ops s2mps11_ldo_ops = {
 	.list_voltage		= regulator_list_voltage_linear,
 	.map_voltage		= regulator_map_voltage_linear,
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -247,7 +247,7 @@ static struct regulator_ops s2mps11_ldo_ops = {
 	.set_voltage_time_sel	= regulator_set_voltage_time_sel,
 };
 
-static struct regulator_ops s2mps11_buck_ops = {
+static const struct regulator_ops s2mps11_buck_ops = {
 	.list_voltage		= regulator_list_voltage_linear,
 	.map_voltage		= regulator_map_voltage_linear,
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -373,7 +373,7 @@ static const struct regulator_desc s2mps11_regulators[] = {
 	regulator_desc_s2mps11_buck6_10(10, MIN_750_MV, STEP_12_5_MV),
 };
 
-static struct regulator_ops s2mps14_reg_ops;
+static const struct regulator_ops s2mps14_reg_ops;
 
 #define regulator_desc_s2mps13_ldo(num, min, step, min_sel) {	\
 	.name		= "LDO"#num,				\
@@ -580,7 +580,7 @@ static int s2mps14_regulator_set_suspend_disable(struct regulator_dev *rdev)
 			rdev->desc->enable_mask, state);
 }
 
-static struct regulator_ops s2mps14_reg_ops = {
+static const struct regulator_ops s2mps14_reg_ops = {
 	.list_voltage		= regulator_list_voltage_linear,
 	.map_voltage		= regulator_map_voltage_linear,
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -662,7 +662,7 @@ static const struct regulator_desc s2mps14_regulators[] = {
 				    S2MPS14_BUCK1235_START_SEL),
 };
 
-static struct regulator_ops s2mps15_reg_ldo_ops = {
+static const struct regulator_ops s2mps15_reg_ldo_ops = {
 	.list_voltage		= regulator_list_voltage_linear_range,
 	.map_voltage		= regulator_map_voltage_linear_range,
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -672,7 +672,7 @@ static struct regulator_ops s2mps15_reg_ldo_ops = {
 	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
 };
 
-static struct regulator_ops s2mps15_reg_buck_ops = {
+static const struct regulator_ops s2mps15_reg_buck_ops = {
 	.list_voltage		= regulator_list_voltage_linear_range,
 	.map_voltage		= regulator_map_voltage_linear_range,
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -866,7 +866,7 @@ static int s2mpu02_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
 				  ramp_val << ramp_shift);
 }
 
-static struct regulator_ops s2mpu02_ldo_ops = {
+static const struct regulator_ops s2mpu02_ldo_ops = {
 	.list_voltage		= regulator_list_voltage_linear,
 	.map_voltage		= regulator_map_voltage_linear,
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -878,7 +878,7 @@ static struct regulator_ops s2mpu02_ldo_ops = {
 	.set_suspend_disable	= s2mps14_regulator_set_suspend_disable,
 };
 
-static struct regulator_ops s2mpu02_buck_ops = {
+static const struct regulator_ops s2mpu02_buck_ops = {
 	.list_voltage		= regulator_list_voltage_linear,
 	.map_voltage		= regulator_map_voltage_linear,
 	.is_enabled		= regulator_is_enabled_regmap,
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 58f5d3b..34f63f1 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -356,7 +356,7 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
 	return 0;
 }
 
-static struct regulator_ops s5m8767_ops = {
+static const struct regulator_ops s5m8767_ops = {
 	.list_voltage		= regulator_list_voltage_linear,
 	.is_enabled		= regulator_is_enabled_regmap,
 	.enable			= regulator_enable_regmap,
@@ -366,7 +366,7 @@ static struct regulator_ops s5m8767_ops = {
 	.set_voltage_time_sel	= s5m8767_set_voltage_time_sel,
 };
 
-static struct regulator_ops s5m8767_buck78_ops = {
+static const struct regulator_ops s5m8767_buck78_ops = {
 	.list_voltage		= regulator_list_voltage_linear,
 	.is_enabled		= regulator_is_enabled_regmap,
 	.enable			= regulator_enable_regmap,


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

* Re: [PATCH] regulator: s2m,s5m: constify regulator_ops structures
  2015-12-19 14:58 [PATCH] regulator: s2m,s5m: constify regulator_ops structures Julia Lawall
@ 2015-12-23  0:00 ` Mark Brown
  2015-12-23  7:20   ` Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2015-12-23  0:00 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Sangbeom Kim, kernel-janitors, Krzysztof Kozlowski,
	Liam Girdwood, linux-kernel, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

On Sat, Dec 19, 2015 at 03:58:00PM +0100, Julia Lawall wrote:
> The regulator_ops structures are never modified, so declare them as const.
> 
> Done with the help of Coccinelle.

This doesn't apply against current code, please check and resend.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] regulator: s2m,s5m: constify regulator_ops structures
  2015-12-23  0:00 ` Mark Brown
@ 2015-12-23  7:20   ` Julia Lawall
  2015-12-23 11:37     ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2015-12-23  7:20 UTC (permalink / raw)
  To: Mark Brown
  Cc: Sangbeom Kim, kernel-janitors, Krzysztof Kozlowski,
	Liam Girdwood, linux-kernel, linux-samsung-soc



On Wed, 23 Dec 2015, Mark Brown wrote:

> On Sat, Dec 19, 2015 at 03:58:00PM +0100, Julia Lawall wrote:
> > The regulator_ops structures are never modified, so declare them as const.
> > 
> > Done with the help of Coccinelle.
> 
> This doesn't apply against current code, please check and resend.

It works fine for me on today's linux-next (80c75a0f1d).  What goes wrong?

julia

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

* Re: [PATCH] regulator: s2m,s5m: constify regulator_ops structures
  2015-12-23  7:20   ` Julia Lawall
@ 2015-12-23 11:37     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-12-23 11:37 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Sangbeom Kim, kernel-janitors, Krzysztof Kozlowski,
	Liam Girdwood, linux-kernel, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

On Wed, Dec 23, 2015 at 08:20:43AM +0100, Julia Lawall wrote:
> On Wed, 23 Dec 2015, Mark Brown wrote:

> > On Sat, Dec 19, 2015 at 03:58:00PM +0100, Julia Lawall wrote:
> > > The regulator_ops structures are never modified, so declare them as const.

> > > Done with the help of Coccinelle.

> > This doesn't apply against current code, please check and resend.

> It works fine for me on today's linux-next (80c75a0f1d).  What goes wrong?

It just doesn't apply against my tree.  Presumably there's a change
somewhere else in -next (probably the MFD tree).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2015-12-23 11:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-19 14:58 [PATCH] regulator: s2m,s5m: constify regulator_ops structures Julia Lawall
2015-12-23  0:00 ` Mark Brown
2015-12-23  7:20   ` Julia Lawall
2015-12-23 11:37     ` 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).