LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_ops
@ 2019-05-24 10:02 Axel Lin
  2019-05-24 10:02 ` [PATCH 2/2] regulator: slg51000: Remove unneeded regl_pdata from struct slg51000 Axel Lin
  2019-05-24 12:12 ` Applied "regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_ops" " Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2019-05-24 10:02 UTC (permalink / raw)
  To: Mark Brown
  Cc: Eric Jeong, Support Opensource, Liam Girdwood, linux-kernel, Axel Lin

These regulator_ops variables never need to be modified, make them const so
compiler can put them to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/slg51000-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/slg51000-regulator.c b/drivers/regulator/slg51000-regulator.c
index 12e21d43030b..a06a18f220e0 100644
--- a/drivers/regulator/slg51000-regulator.c
+++ b/drivers/regulator/slg51000-regulator.c
@@ -183,7 +183,7 @@ static const struct regmap_config slg51000_regmap_config = {
 	.volatile_table = &slg51000_volatile_table,
 };
 
-static struct regulator_ops slg51000_regl_ops = {
+static const struct regulator_ops slg51000_regl_ops = {
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
 	.is_enabled = regulator_is_enabled_regmap,
@@ -193,7 +193,7 @@ static struct regulator_ops slg51000_regl_ops = {
 	.set_voltage_sel = regulator_set_voltage_sel_regmap,
 };
 
-static struct regulator_ops slg51000_switch_ops = {
+static const struct regulator_ops slg51000_switch_ops = {
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
 	.is_enabled = regulator_is_enabled_regmap,
-- 
2.20.1


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

* [PATCH 2/2] regulator: slg51000: Remove unneeded regl_pdata from struct slg51000
  2019-05-24 10:02 [PATCH 1/2] regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_ops Axel Lin
@ 2019-05-24 10:02 ` Axel Lin
  2019-05-24 12:12   ` Applied "regulator: slg51000: Remove unneeded regl_pdata from struct slg51000" to the regulator tree Mark Brown
  2019-05-24 12:12 ` Applied "regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_ops" " Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Axel Lin @ 2019-05-24 10:02 UTC (permalink / raw)
  To: Mark Brown
  Cc: Eric Jeong, Support Opensource, Liam Girdwood, linux-kernel, Axel Lin

Just use a local variable *ena_gpiod in slg51000_of_parse_cb instead.
With this change, the struct slg51000_pdata can be removed.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/slg51000-regulator.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/slg51000-regulator.c b/drivers/regulator/slg51000-regulator.c
index a06a18f220e0..04b732991d69 100644
--- a/drivers/regulator/slg51000-regulator.c
+++ b/drivers/regulator/slg51000-regulator.c
@@ -35,14 +35,9 @@ enum slg51000_regulators {
 	SLG51000_MAX_REGULATORS,
 };
 
-struct slg51000_pdata {
-	struct gpio_desc *ena_gpiod;
-};
-
 struct slg51000 {
 	struct device *dev;
 	struct regmap *regmap;
-	struct slg51000_pdata regl_pdata[SLG51000_MAX_REGULATORS];
 	struct regulator_desc *rdesc[SLG51000_MAX_REGULATORS];
 	struct regulator_dev *rdev[SLG51000_MAX_REGULATORS];
 	struct gpio_desc *cs_gpiod;
@@ -204,14 +199,14 @@ static int slg51000_of_parse_cb(struct device_node *np,
 				struct regulator_config *config)
 {
 	struct slg51000 *chip = config->driver_data;
-	struct slg51000_pdata *rpdata = &chip->regl_pdata[desc->id];
+	struct gpio_desc *ena_gpiod;
 	enum gpiod_flags gflags = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
 
-	rpdata->ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
-							"enable-gpios", 0,
-							gflags, "gpio-en-ldo");
-	if (rpdata->ena_gpiod) {
-		config->ena_gpiod = rpdata->ena_gpiod;
+	ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
+						"enable-gpios", 0,
+						gflags, "gpio-en-ldo");
+	if (ena_gpiod) {
+		config->ena_gpiod = ena_gpiod;
 		devm_gpiod_unhinge(chip->dev, config->ena_gpiod);
 	}
 
-- 
2.20.1


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

* Applied "regulator: slg51000: Remove unneeded regl_pdata from struct slg51000" to the regulator tree
  2019-05-24 10:02 ` [PATCH 2/2] regulator: slg51000: Remove unneeded regl_pdata from struct slg51000 Axel Lin
@ 2019-05-24 12:12   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2019-05-24 12:12 UTC (permalink / raw)
  To: Axel Lin
  Cc: Eric Jeong, Liam Girdwood, linux-kernel, Mark Brown, Support Opensource

The patch

   regulator: slg51000: Remove unneeded regl_pdata from struct slg51000

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 12c574d84c8e492320a4e75b2c1157f8b61e4092 Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Fri, 24 May 2019 18:02:47 +0800
Subject: [PATCH] regulator: slg51000: Remove unneeded regl_pdata from struct
 slg51000

Just use a local variable *ena_gpiod in slg51000_of_parse_cb instead.
With this change, the struct slg51000_pdata can be removed.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/slg51000-regulator.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/slg51000-regulator.c b/drivers/regulator/slg51000-regulator.c
index a06a18f220e0..04b732991d69 100644
--- a/drivers/regulator/slg51000-regulator.c
+++ b/drivers/regulator/slg51000-regulator.c
@@ -35,14 +35,9 @@ enum slg51000_regulators {
 	SLG51000_MAX_REGULATORS,
 };
 
-struct slg51000_pdata {
-	struct gpio_desc *ena_gpiod;
-};
-
 struct slg51000 {
 	struct device *dev;
 	struct regmap *regmap;
-	struct slg51000_pdata regl_pdata[SLG51000_MAX_REGULATORS];
 	struct regulator_desc *rdesc[SLG51000_MAX_REGULATORS];
 	struct regulator_dev *rdev[SLG51000_MAX_REGULATORS];
 	struct gpio_desc *cs_gpiod;
@@ -204,14 +199,14 @@ static int slg51000_of_parse_cb(struct device_node *np,
 				struct regulator_config *config)
 {
 	struct slg51000 *chip = config->driver_data;
-	struct slg51000_pdata *rpdata = &chip->regl_pdata[desc->id];
+	struct gpio_desc *ena_gpiod;
 	enum gpiod_flags gflags = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
 
-	rpdata->ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
-							"enable-gpios", 0,
-							gflags, "gpio-en-ldo");
-	if (rpdata->ena_gpiod) {
-		config->ena_gpiod = rpdata->ena_gpiod;
+	ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
+						"enable-gpios", 0,
+						gflags, "gpio-en-ldo");
+	if (ena_gpiod) {
+		config->ena_gpiod = ena_gpiod;
 		devm_gpiod_unhinge(chip->dev, config->ena_gpiod);
 	}
 
-- 
2.20.1


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

* Applied "regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_ops" to the regulator tree
  2019-05-24 10:02 [PATCH 1/2] regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_ops Axel Lin
  2019-05-24 10:02 ` [PATCH 2/2] regulator: slg51000: Remove unneeded regl_pdata from struct slg51000 Axel Lin
@ 2019-05-24 12:12 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2019-05-24 12:12 UTC (permalink / raw)
  To: Axel Lin
  Cc: Eric Jeong, Liam Girdwood, linux-kernel, Mark Brown, Support Opensource

The patch

   regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_ops

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 0a33d4feea748399c9341ff054c5f29c98393d35 Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Fri, 24 May 2019 18:02:46 +0800
Subject: [PATCH] regulator: slg51000: Constify slg51000_regl_ops and
 slg51000_switch_ops

These regulator_ops variables never need to be modified, make them const so
compiler can put them to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/slg51000-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/slg51000-regulator.c b/drivers/regulator/slg51000-regulator.c
index 12e21d43030b..a06a18f220e0 100644
--- a/drivers/regulator/slg51000-regulator.c
+++ b/drivers/regulator/slg51000-regulator.c
@@ -183,7 +183,7 @@ static const struct regmap_config slg51000_regmap_config = {
 	.volatile_table = &slg51000_volatile_table,
 };
 
-static struct regulator_ops slg51000_regl_ops = {
+static const struct regulator_ops slg51000_regl_ops = {
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
 	.is_enabled = regulator_is_enabled_regmap,
@@ -193,7 +193,7 @@ static struct regulator_ops slg51000_regl_ops = {
 	.set_voltage_sel = regulator_set_voltage_sel_regmap,
 };
 
-static struct regulator_ops slg51000_switch_ops = {
+static const struct regulator_ops slg51000_switch_ops = {
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
 	.is_enabled = regulator_is_enabled_regmap,
-- 
2.20.1


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

end of thread, other threads:[~2019-05-24 12:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24 10:02 [PATCH 1/2] regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_ops Axel Lin
2019-05-24 10:02 ` [PATCH 2/2] regulator: slg51000: Remove unneeded regl_pdata from struct slg51000 Axel Lin
2019-05-24 12:12   ` Applied "regulator: slg51000: Remove unneeded regl_pdata from struct slg51000" to the regulator tree Mark Brown
2019-05-24 12:12 ` Applied "regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_ops" " 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).