@ -1538,6 +1538,10 @@ static void mhi_dev_trigger_cb(enum mhi_client_channel ch_id)
struct mhi_dev_ready_cb_info * info ;
enum mhi_ctrl_info state_data ;
/* Currently no clients register for HW channel notification */
if ( ch_id > = MHI_MAX_SOFTWARE_CHANNELS )
return ;
list_for_each_entry ( info , & mhi_ctx - > client_cb_list , list )
if ( info - > cb & & info - > cb_data . channel = = ch_id ) {
mhi_ctrl_state_info ( info - > cb_data . channel , & state_data ) ;
@ -2036,7 +2040,7 @@ static void mhi_update_state_info_all(enum mhi_ctrl_info info)
struct mhi_dev_client_cb_reason reason ;
mhi_ctx - > ctrl_info = info ;
for ( i = 0 ; i < MHI_MAX_CHANNELS ; + + i ) {
for ( i = 0 ; i < MHI_MAX_SOFTWARE_ CHANNELS ; + + i ) {
channel_state_info [ i ] . ctrl_info = info ;
/* Notify kernel clients */
mhi_dev_trigger_cb ( i ) ;
@ -3333,7 +3337,7 @@ int mhi_register_state_cb(void (*mhi_state_cb)
if ( WARN_ON ( ! mhi_ctx ) )
return - ENXIO ;
if ( channel > MHI_MAX_CHANNELS ) {
if ( channel > = MHI_MAX_SOFTWARE _CHANNELS ) {
pr_err ( " Invalid channel :%d \n " , channel ) ;
return - EINVAL ;
}
@ -3373,6 +3377,10 @@ static void mhi_update_state_info_ch(uint32_t ch_id, enum mhi_ctrl_info info)
{
struct mhi_dev_client_cb_reason reason ;
/* Currently no clients register for HW channel notification */
if ( ch_id > = MHI_MAX_SOFTWARE_CHANNELS )
return ;
channel_state_info [ ch_id ] . ctrl_info = info ;
if ( ch_id = = MHI_CLIENT_QMI_OUT | | ch_id = = MHI_CLIENT_QMI_IN ) {
/* For legacy reasons for QTI client */
@ -3392,7 +3400,7 @@ int mhi_ctrl_state_info(uint32_t idx, uint32_t *info)
if ( idx = = MHI_DEV_UEVENT_CTRL )
* info = mhi_ctx - > ctrl_info ;
else
if ( idx < MHI_MAX_CHANNELS )
if ( idx < MHI_MAX_SOFTWARE_ CHANNELS )
* info = channel_state_info [ idx ] . ctrl_info ;
else
return - EINVAL ;