diff options
author | Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> | 2023-11-27 14:22:07 +0300 |
---|---|---|
committer | Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> | 2023-12-15 11:50:13 +0300 |
commit | 309ab14f70d137f708ca52e275dc9fd20d3e9147 (patch) | |
tree | a74d9cb0ef91fe0ab7f378b9b55f05f13693db6d /drivers | |
parent | 2547beb00ddb40e55b773970622421d978f71473 (diff) | |
download | linux-309ab14f70d137f708ca52e275dc9fd20d3e9147.tar.xz |
bus: mhi: ep: Add checks for read/write callbacks while registering controllers
The MHI EP controller drivers has to support both sync and async read/write
callbacks. Hence, add a check for it.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/bus/mhi/ep/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c index 063c07241da7..65fc1d738bec 100644 --- a/drivers/bus/mhi/ep/main.c +++ b/drivers/bus/mhi/ep/main.c @@ -1464,6 +1464,10 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl, if (!mhi_cntrl || !mhi_cntrl->cntrl_dev || !mhi_cntrl->mmio || !mhi_cntrl->irq) return -EINVAL; + if (!mhi_cntrl->read_sync || !mhi_cntrl->write_sync || + !mhi_cntrl->read_async || !mhi_cntrl->write_async) + return -EINVAL; + ret = mhi_ep_chan_init(mhi_cntrl, config); if (ret) return ret; |