static void get_spk_protection_status(struct msm_spk_prot_status *status) { /*Call AFE function here to query the status*/ struct afe_spkr_prot_get_vi_calib calib_resp; if (status) { status->status = -EINVAL; if (!afe_spk_prot_get_calib_data(&calib_resp)) { if (calib_resp.res_cfg.th_vi_ca_state == 1) status->status = -EAGAIN; else if (calib_resp.res_cfg.th_vi_ca_state == 2) { status->status = 0; status->r0 = calib_resp.res_cfg.r0_cali_q24; } } } else pr_err("%s invalid params\n", __func__); }
static int get_spk_protection_status(struct msm_spk_prot_status *status) { int result = 0; struct afe_spkr_prot_get_vi_calib calib_resp; pr_debug("%s,\n", __func__); /*Call AFE function here to query the status*/ if (status) { status->status = -EINVAL; if (!afe_spk_prot_get_calib_data(&calib_resp)) { if (calib_resp.res_cfg.th_vi_ca_state == 1) status->status = -EAGAIN; else if (calib_resp.res_cfg.th_vi_ca_state == 2) { status->status = 0; status->r0 = calib_resp.res_cfg.r0_cali_q24; } } } else { pr_err("%s invalid params\n", __func__); result = -EINVAL; } return result; }