aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorFei Shao <[email protected]>2023-12-06 15:17:26 -0800
committerGreg Kroah-Hartman <[email protected]>2023-12-15 17:27:04 +0100
commitb6e53731e07db7e8d35b789fd83565fe75540180 (patch)
tree551373b015be1612f69ee64f49d3320856261082 /include/linux
parente821d50ab5b956ed0effa49faaf29912fd4106d9 (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() [[email protected]: Rename to spmi-devres for module niceness, slap on GPL module license] Signed-off-by: Fei Shao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/spmi.h3
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