* [PATCH] mfd: core: constify the struct device_type usage
@ 2024-02-19 19:51 Ricardo B. Marliere
2024-02-23 16:27 ` (subset) " Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Ricardo B. Marliere @ 2024-02-19 19:51 UTC (permalink / raw)
To: Lee Jones; +Cc: linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere
Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the mfd_dev_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
drivers/mfd/mfd-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 2b85509a90fc..6ad5c93027af 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -29,7 +29,7 @@ struct mfd_of_node_entry {
struct device_node *np;
};
-static struct device_type mfd_dev_type = {
+static const struct device_type mfd_dev_type = {
.name = "mfd_device",
};
---
base-commit: d5132d176d6f21742ac67fd311ccc61fe830e999
change-id: 20240219-device_cleanup-mfd-885cbab2befe
Best regards,
--
Ricardo B. Marliere <ricardo@marliere.net>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: (subset) [PATCH] mfd: core: constify the struct device_type usage
2024-02-19 19:51 [PATCH] mfd: core: constify the struct device_type usage Ricardo B. Marliere
@ 2024-02-23 16:27 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2024-02-23 16:27 UTC (permalink / raw)
To: Lee Jones, Ricardo B. Marliere; +Cc: linux-kernel, Greg Kroah-Hartman
On Mon, 19 Feb 2024 16:51:10 -0300, Ricardo B. Marliere wrote:
> Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
> core can properly handle constant struct device_type. Move the mfd_dev_type
> variable to be a constant structure as well, placing it into read-only
> memory which can not be modified at runtime.
>
>
Applied, thanks!
[1/1] mfd: core: constify the struct device_type usage
commit: 3cb10854004d2cb9c8f3a33deeeb499d0e0c7120
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-23 16:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-19 19:51 [PATCH] mfd: core: constify the struct device_type usage Ricardo B. Marliere
2024-02-23 16:27 ` (subset) " Lee Jones
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®