summaryrefslogtreecommitdiff
path: root/include/linux/mhi.h
diff options
context:
space:
mode:
authorBhaumik Bhatt <bbhatt@codeaurora.org>2020-09-29 20:52:09 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-02 12:33:47 +0300
commitf42dfbe8f712127031e7b9bc938a1c33cec2ff57 (patch)
treea04eea1edfbc6479b78de779604860372bcd32ac /include/linux/mhi.h
parent8e3729bfa7be159d1f94d0caab9c1beff8268672 (diff)
downloadlinux-f42dfbe8f712127031e7b9bc938a1c33cec2ff57.tar.xz
bus: mhi: core: Introduce APIs to allocate and free the MHI controller
Client devices should use the APIs provided to allocate and free the MHI controller structure. This will help ensure that the structure is zero-initialized and there are no false positives with respect to reading any values such as the serial number or the OEM PK hash. Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/20200929175218.8178-11-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/mhi.h')
-rw-r--r--include/linux/mhi.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/mhi.h b/include/linux/mhi.h
index 0c97f4bc5fae..6b987e8cc438 100644
--- a/include/linux/mhi.h
+++ b/include/linux/mhi.h
@@ -528,6 +528,18 @@ struct mhi_driver {
#define to_mhi_device(dev) container_of(dev, struct mhi_device, dev)
/**
+ * mhi_alloc_controller - Allocate the MHI Controller structure
+ * Allocate the mhi_controller structure using zero initialized memory
+ */
+struct mhi_controller *mhi_alloc_controller(void);
+
+/**
+ * mhi_free_controller - Free the MHI Controller structure
+ * Free the mhi_controller structure which was previously allocated
+ */
+void mhi_free_controller(struct mhi_controller *mhi_cntrl);
+
+/**
* mhi_register_controller - Register MHI controller
* @mhi_cntrl: MHI controller to register
* @config: Configuration to use for the controller