* [PATCH] clk: cdce925: make regmap_cdce925_bus constant
@ 2024-10-01 9:00 Javier Carrasco
2024-10-09 23:13 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: Javier Carrasco @ 2024-10-01 9:00 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd; +Cc: linux-clk, linux-kernel, Javier Carrasco
This struct is only used for the regmap initialization via
devm_regmap_init() (which expects a pointer to a const struct
regmap_bus, as it will not modify the struct), and it is not modified
after its declaration.
Move regmap_cdce925_bus to a read-only section.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
drivers/clk/clk-cdce925.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk-cdce925.c b/drivers/clk/clk-cdce925.c
index e48be7a6c0e2..c51818c1af98 100644
--- a/drivers/clk/clk-cdce925.c
+++ b/drivers/clk/clk-cdce925.c
@@ -601,7 +601,7 @@ static int cdce925_regulator_enable(struct device *dev, const char *name)
/* The CDCE925 uses a funky way to read/write registers. Bulk mode is
* just weird, so just use the single byte mode exclusively. */
-static struct regmap_bus regmap_cdce925_bus = {
+static const struct regmap_bus regmap_cdce925_bus = {
.write = cdce925_regmap_i2c_write,
.read = cdce925_regmap_i2c_read,
};
---
base-commit: 77df9e4bb2224d8ffbddec04c333a9d7965dad6c
change-id: 20241001-clk-cdce925-regmap_bus-const-391d2fbd2cd9
Best regards,
--
Javier Carrasco <javier.carrasco.cruz@gmail.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: cdce925: make regmap_cdce925_bus constant
2024-10-01 9:00 [PATCH] clk: cdce925: make regmap_cdce925_bus constant Javier Carrasco
@ 2024-10-09 23:13 ` Stephen Boyd
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2024-10-09 23:13 UTC (permalink / raw)
To: Javier Carrasco, Michael Turquette
Cc: linux-clk, linux-kernel, Javier Carrasco
Quoting Javier Carrasco (2024-10-01 02:00:11)
> This struct is only used for the regmap initialization via
> devm_regmap_init() (which expects a pointer to a const struct
> regmap_bus, as it will not modify the struct), and it is not modified
> after its declaration.
>
> Move regmap_cdce925_bus to a read-only section.
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-09 23:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01 9:00 [PATCH] clk: cdce925: make regmap_cdce925_bus constant Javier Carrasco
2024-10-09 23:13 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox