mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-01 16:14:13 +08:00
bus: mhi: core: Check for IRQ availability during registration
Current design allows a controller to register with MHI successfully without the need to have any IRQs available for use. If no IRQs are available, power up requests to MHI can fail after a successful registration with MHI. Improve the design by checking for the number of IRQs available sooner within the mhi_regsiter_controller() API as it is required to be specified by the controller. Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
This commit is contained in:
parent
dc53d862ea
commit
40c3127187
@ -858,7 +858,7 @@ int mhi_register_controller(struct mhi_controller *mhi_cntrl,
|
|||||||
|
|
||||||
if (!mhi_cntrl->runtime_get || !mhi_cntrl->runtime_put ||
|
if (!mhi_cntrl->runtime_get || !mhi_cntrl->runtime_put ||
|
||||||
!mhi_cntrl->status_cb || !mhi_cntrl->read_reg ||
|
!mhi_cntrl->status_cb || !mhi_cntrl->read_reg ||
|
||||||
!mhi_cntrl->write_reg)
|
!mhi_cntrl->write_reg || !mhi_cntrl->nr_irqs)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ret = parse_config(mhi_cntrl, config);
|
ret = parse_config(mhi_cntrl, config);
|
||||||
|
@ -926,9 +926,6 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
|
|||||||
|
|
||||||
dev_info(dev, "Requested to power ON\n");
|
dev_info(dev, "Requested to power ON\n");
|
||||||
|
|
||||||
if (mhi_cntrl->nr_irqs < 1)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
/* Supply default wake routines if not provided by controller driver */
|
/* Supply default wake routines if not provided by controller driver */
|
||||||
if (!mhi_cntrl->wake_get || !mhi_cntrl->wake_put ||
|
if (!mhi_cntrl->wake_get || !mhi_cntrl->wake_put ||
|
||||||
!mhi_cntrl->wake_toggle) {
|
!mhi_cntrl->wake_toggle) {
|
||||||
|
Loading…
Reference in New Issue
Block a user