gunyah: gh_rm_drv: Add error return if RM device is not ready

Some driver may probe before RM driver, so we need return probe defer to
let these driver use RM call after RM device is ready.

Change-Id: I65cf5eab7b99ca2a58c32f2d83794a210350fb05
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
This commit is contained in:
Cong Zhang 2022-06-01 16:16:55 +08:00 committed by Gerrit - the friendly Code Review server
parent 7f426d2858
commit 34989b4a03

View File

@ -602,6 +602,12 @@ static int gh_rm_send_request(u32 message_id,
void *send_buff;
int i, ret;
/* Drivers need probe defer
* when do RM call before RM driver initialized
*/
if (gh_rm_msgq_desc == NULL)
return -EPROBE_DEFER;
num_fragments = (req_buff_size + GH_RM_MAX_MSG_SIZE_BYTES - 1) /
GH_RM_MAX_MSG_SIZE_BYTES;