* [PATCH 0/2] regulator: Constify read-only regmap_config struct
@ 2024-07-04 18:13 Javier Carrasco
2024-07-04 18:13 ` [PATCH 1/2] regulator: da9121: Constify struct regmap_config Javier Carrasco
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Javier Carrasco @ 2024-07-04 18:13 UTC (permalink / raw)
To: Support Opensource, Liam Girdwood, Mark Brown
Cc: linux-kernel, Javier Carrasco
This series adds the const modifier to the remaining regmap_config
structs in the regulator subsystem that are effectively used as const
(i.e., only read after their declaration), but kept ad writtable data.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
Javier Carrasco (2):
regulator: da9121: Constify struct regmap_config
regulator: max77857: Constify struct regmap_config
drivers/regulator/da9121-regulator.c | 6 +++---
drivers/regulator/max77857-regulator.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
---
base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233
change-id: 20240704-regulator-const-regmap-2701f2387dad
Best regards,
--
Javier Carrasco <javier.carrasco.cruz@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] regulator: da9121: Constify struct regmap_config
2024-07-04 18:13 [PATCH 0/2] regulator: Constify read-only regmap_config struct Javier Carrasco
@ 2024-07-04 18:13 ` Javier Carrasco
2024-07-04 18:13 ` [PATCH 2/2] regulator: max77857: " Javier Carrasco
2024-07-04 20:00 ` [PATCH 0/2] regulator: Constify read-only regmap_config struct Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Javier Carrasco @ 2024-07-04 18:13 UTC (permalink / raw)
To: Support Opensource, Liam Girdwood, Mark Brown
Cc: linux-kernel, Javier Carrasco
`da9121_1ch_regmap_config` and `da9121_2ch_regmap_config` are not
modified and can be declared as const to move their data to a
read-only section.
The pointer that references those structs has been converted to const
accordingly.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
drivers/regulator/da9121-regulator.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c
index 3571b6242e3a..d97162f73793 100644
--- a/drivers/regulator/da9121-regulator.c
+++ b/drivers/regulator/da9121-regulator.c
@@ -865,7 +865,7 @@ static const struct regmap_access_table da9121_volatile_table = {
};
/* DA9121 regmap config for 1 channel variants */
-static struct regmap_config da9121_1ch_regmap_config = {
+static const struct regmap_config da9121_1ch_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = DA9121_REG_OTP_CONFIG_ID,
@@ -876,7 +876,7 @@ static struct regmap_config da9121_1ch_regmap_config = {
};
/* DA9121 regmap config for 2 channel variants */
-static struct regmap_config da9121_2ch_regmap_config = {
+static const struct regmap_config da9121_2ch_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = DA9121_REG_OTP_CONFIG_ID,
@@ -993,7 +993,7 @@ static int da9121_check_device_type(struct i2c_client *i2c, struct da9121 *chip)
static int da9121_assign_chip_model(struct i2c_client *i2c,
struct da9121 *chip)
{
- struct regmap_config *regmap;
+ const struct regmap_config *regmap;
int ret = 0;
chip->dev = &i2c->dev;
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] regulator: max77857: Constify struct regmap_config
2024-07-04 18:13 [PATCH 0/2] regulator: Constify read-only regmap_config struct Javier Carrasco
2024-07-04 18:13 ` [PATCH 1/2] regulator: da9121: Constify struct regmap_config Javier Carrasco
@ 2024-07-04 18:13 ` Javier Carrasco
2024-07-04 20:00 ` [PATCH 0/2] regulator: Constify read-only regmap_config struct Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Javier Carrasco @ 2024-07-04 18:13 UTC (permalink / raw)
To: Support Opensource, Liam Girdwood, Mark Brown
Cc: linux-kernel, Javier Carrasco
`max77857_remgap_config` is not modified and can be declared as const to
move its data to a read-only section.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
drivers/regulator/max77857-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/max77857-regulator.c b/drivers/regulator/max77857-regulator.c
index 145ad0281857..bc28dc8503a8 100644
--- a/drivers/regulator/max77857-regulator.c
+++ b/drivers/regulator/max77857-regulator.c
@@ -67,7 +67,7 @@ static bool max77857_volatile_reg(struct device *dev, unsigned int reg)
}
}
-static struct regmap_config max77857_regmap_config = {
+static const struct regmap_config max77857_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.cache_type = REGCACHE_MAPLE,
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] regulator: Constify read-only regmap_config struct
2024-07-04 18:13 [PATCH 0/2] regulator: Constify read-only regmap_config struct Javier Carrasco
2024-07-04 18:13 ` [PATCH 1/2] regulator: da9121: Constify struct regmap_config Javier Carrasco
2024-07-04 18:13 ` [PATCH 2/2] regulator: max77857: " Javier Carrasco
@ 2024-07-04 20:00 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2024-07-04 20:00 UTC (permalink / raw)
To: Support Opensource, Liam Girdwood, Javier Carrasco; +Cc: linux-kernel
On Thu, 04 Jul 2024 20:13:06 +0200, Javier Carrasco wrote:
> This series adds the const modifier to the remaining regmap_config
> structs in the regulator subsystem that are effectively used as const
> (i.e., only read after their declaration), but kept ad writtable data.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/2] regulator: da9121: Constify struct regmap_config
commit: 05db2e27b92302a43f996561dbb58ecabc3cc85d
[2/2] regulator: max77857: Constify struct regmap_config
commit: 32d1171014a74c788218e0a8a5fd6fef65fb10ba
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-04 20:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 18:13 [PATCH 0/2] regulator: Constify read-only regmap_config struct Javier Carrasco
2024-07-04 18:13 ` [PATCH 1/2] regulator: da9121: Constify struct regmap_config Javier Carrasco
2024-07-04 18:13 ` [PATCH 2/2] regulator: max77857: " Javier Carrasco
2024-07-04 20:00 ` [PATCH 0/2] regulator: Constify read-only regmap_config struct Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox