diff options
author | Fei Shao <fshao@chromium.org> | 2023-12-06 15:17:26 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-15 17:27:04 +0100 |
commit | b6e53731e07db7e8d35b789fd83565fe75540180 (patch) | |
tree | 551373b015be1612f69ee64f49d3320856261082 /include/linux/spmi.h | |
parent | e821d50ab5b956ed0effa49faaf29912fd4106d9 (diff) |
spmi: Introduce device-managed functions
Utilize the managed resource (devres) framework and add the following
devm_* helpers for the SPMI driver:
- devm_spmi_controller_alloc()
- devm_spmi_controller_add()
[sboyd@kernel.org: Rename to spmi-devres for module niceness, slap on
GPL module license]
Signed-off-by: Fei Shao <fshao@chromium.org>
Link: https://lore.kernel.org/r/20230824104101.4083400-2-fshao@chromium.org
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20231206231733.4031901-4-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/spmi.h')
-rw-r--r-- | include/linux/spmi.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/spmi.h b/include/linux/spmi.h index 2a4ce4144f9f..28e8c8bd3944 100644 --- a/include/linux/spmi.h +++ b/include/linux/spmi.h @@ -120,6 +120,9 @@ static inline void spmi_controller_put(struct spmi_controller *ctrl) int spmi_controller_add(struct spmi_controller *ctrl); void spmi_controller_remove(struct spmi_controller *ctrl); +struct spmi_controller *devm_spmi_controller_alloc(struct device *parent, size_t size); +int devm_spmi_controller_add(struct device *parent, struct spmi_controller *ctrl); + /** * struct spmi_driver - SPMI slave device driver * @driver: SPMI device drivers should initialize name and owner field of |