diff options
| author | Rosen Penev <rosenp@gmail.com> | 2026-03-26 19:41:43 -0700 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2026-05-28 18:40:46 -0700 |
| commit | 3443eec9c55d128064c83225a9111f1a1a37277a (patch) | |
| tree | 1153752a8a3527869da905d85e795b8bfef8b17e /include/linux/spmi.h | |
| parent | 0c766f0f08ea681396814fd82eddd299da188625 (diff) | |
| download | linux-next-3443eec9c55d128064c83225a9111f1a1a37277a.tar.gz linux-next-3443eec9c55d128064c83225a9111f1a1a37277a.zip | |
spmi: use kzalloc_flex in main allocation
Add a flexible array member to avoid indexing past the struct.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'include/linux/spmi.h')
| -rw-r--r-- | include/linux/spmi.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/spmi.h b/include/linux/spmi.h index 671ce1b3ee8e..4eb9564a7fb3 100644 --- a/include/linux/spmi.h +++ b/include/linux/spmi.h @@ -76,6 +76,7 @@ void spmi_device_remove(struct spmi_device *sdev); * @cmd: sends a non-data command sequence on the SPMI bus. * @read_cmd: sends a register read command sequence on the SPMI bus. * @write_cmd: sends a register write command sequence on the SPMI bus. + * @priv: array of private data. */ struct spmi_controller { struct device dev; @@ -85,6 +86,7 @@ struct spmi_controller { u8 sid, u16 addr, u8 *buf, size_t len); int (*write_cmd)(struct spmi_controller *ctrl, u8 opcode, u8 sid, u16 addr, const u8 *buf, size_t len); + u8 priv[]; }; static inline struct spmi_controller *to_spmi_controller(struct device *d) |
