summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2024-11-07 12:47:05 +0100
committerLee Jones <lee@kernel.org>2024-12-17 13:14:21 +0000
commitfa52c04daec9ff9820260901a8b1d271bb532d12 (patch)
tree44d6e3d591cba4f6a594f670bd5bd0e699710f2f
parent8a5b38c3fd709e8acd2bfdedf66c25e6af759576 (diff)
mfd: core: Make platform_data pointer const in struct mfd_cell
The content of the platform_data of a struct mfd_cell is simply passed on to the platform_device_add_data() call in mfd_add_device() . platform_device_add_data() already handles the data behind that pointer as const and also uses kmemdup to create a copy of the data before handing that copy over to the newly created platform-device, so there is no reason to not extend this to struct mfd_cell, as the old copy in the mfd_cell will be stale anyway. This allows to pass structs gathered from of_device_get_match_data() as platform-data to sub-devices - which is retrieved as const already. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20241107114712.538976-3-heiko@sntech.de Signed-off-by: Lee Jones <lee@kernel.org>
-rw-r--r--include/linux/mfd/core.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index e8bcad641d8c..faeea7abd688 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -72,7 +72,7 @@ struct mfd_cell {
int (*resume)(struct platform_device *dev);
/* platform data passed to the sub devices drivers */
- void *platform_data;
+ const void *platform_data;
size_t pdata_size;
/* Matches ACPI */